Commit 758a301a authored by mercury233's avatar mercury233

new cards DP20

parent c8910c43
--魔界劇団-コミック・リリーフ
function c15308295.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--control
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(15308295,0))
e1:SetCategory(CATEGORY_CONTROL+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,15308295)
e1:SetTarget(c15308295.cttg)
e1:SetOperation(c15308295.ctop)
c:RegisterEffect(e1)
--avoid damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetValue(1)
c:RegisterEffect(e3)
--control
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(15308295,1))
e4:SetCategory(CATEGORY_CONTROL)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c15308295.ctcon)
e4:SetTarget(c15308295.cttg2)
e4:SetOperation(c15308295.ctop2)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(15308295,2))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_CONTROL_CHANGED)
e5:SetCountLimit(1)
e5:SetTarget(c15308295.destg)
e5:SetOperation(c15308295.desop)
c:RegisterEffect(e5)
end
function c15308295.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsAbleToChangeControler()
end
function c15308295.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(c15308295.ctfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectTarget(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g2=Duel.SelectTarget(tp,c15308295.ctfilter,tp,LOCATION_MZONE,0,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c15308295.ctop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local a=g:GetFirst()
local b=g:GetNext()
if a:IsRelateToEffect(e) and b:IsRelateToEffect(e) and Duel.SwapControl(a,b)~=0 then
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function c15308295.ctcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c15308295.cttg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function c15308295.ctop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.GetControl(c,1-tp)
end
end
function c15308295.desfilter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL) and c:IsSetCard(0x20ec)
end
function c15308295.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,e:GetHandler():GetOwner(),LOCATION_SZONE)
end
function c15308295.desop(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
local g=Duel.GetMatchingGroup(c15308295.desfilter,p,LOCATION_SZONE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(p,aux.Stringid(15308295,3)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DESTROY)
local sg=g:Select(p,1,1,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
--フォトン・ハンド
function c15520842.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,15520842+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c15520842.condition)
e1:SetCost(c15520842.cost)
e1:SetTarget(c15520842.target)
e1:SetOperation(c15520842.activate)
c:RegisterEffect(e1)
end
function c15520842.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c15520842.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c15520842.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c15520842.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c15520842.geffilter(c)
return c:IsFaceup() and c:IsCode(93717133)
end
function c15520842.filter(c,tp)
return (Duel.IsExistingMatchingCard(c15520842.geffilter,tp,LOCATION_ONFIELD,0,1,nil)
or (c:IsFaceup() and c:IsType(TYPE_XYZ))) and c:IsControlerCanBeChanged()
end
function c15520842.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 c15520842.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c15520842.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c15520842.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c15520842.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp)
end
end
--輝光竜フォトン・ブラスト・ドラゴン
function c16643334.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--special summon (hand)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16643334,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c16643334.spcon1)
e1:SetTarget(c16643334.sptg1)
e1:SetOperation(c16643334.spop1)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c16643334.indcon)
e2:SetTarget(aux.TargetBoolFunction(Card.IsAttackAbove,2000))
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c16643334.indcon)
e3:SetTarget(aux.TargetBoolFunction(Card.IsAttackAbove,2000))
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--special summon (gy/banished)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(16643334,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMING_BATTLE_START+TIMING_END_PHASE)
e4:SetCondition(c16643334.spcon2)
e4:SetCost(c16643334.spcost2)
e4:SetTarget(c16643334.sptg2)
e4:SetOperation(c16643334.spop2)
c:RegisterEffect(e4)
end
function c16643334.spcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c16643334.spfilter1(c,e,tp)
return c:IsSetCard(0x55) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c16643334.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c16643334.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c16643334.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c16643334.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c16643334.indcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c16643334.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c16643334.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c16643334.spfilter2(c,e,tp)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsCode(93717133) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c16643334.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c16643334.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c16643334.spfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c16643334.spfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c16643334.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--BF-南風のアウステル
function c17465972.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17465972,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c17465972.sumtg)
e2:SetOperation(c17465972.sumop)
c:RegisterEffect(e2)
--counter
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17465972,1))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c17465972.cttg1)
e3:SetOperation(c17465972.ctop1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(17465972,2))
e4:SetTarget(c17465972.cttg2)
e4:SetOperation(c17465972.ctop2)
c:RegisterEffect(e4)
end
function c17465972.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsSetCard(0x33) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c17465972.sumtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c17465972.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c17465972.filter,tp,LOCATION_REMOVED,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,c17465972.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c17465972.sumop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c17465972.ctfilter1(c,ct)
return c:IsFaceup() and c:IsCode(9012916) and c:IsCanAddCounter(0x10,ct)
end
function c17465972.cttg1(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(c17465972.ctfilter1,tp,LOCATION_MZONE,0,1,nil,ct) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,ct,0,0x10)
end
function c17465972.ctop1(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if ct>0 then
local g=Duel.SelectMatchingCard(tp,c17465972.ctfilter1,tp,LOCATION_MZONE,0,1,1,nil,ct)
local tc=g:GetFirst()
if tc then
tc:AddCounter(0x10,ct)
end
end
end
function c17465972.ctfilter2(c)
return c:IsFaceup() and c:GetCounter(0x1002)==0 and c:IsCanAddCounter(0x1002,1)
end
function c17465972.cttg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17465972.ctfilter2,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x1002)
end
function c17465972.ctop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c17465972.ctfilter2,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
tc:AddCounter(0x1002,1)
tc=g:GetNext()
end
end
--サイバネティック・レボリューション
function c18597560.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,18597560+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c18597560.cost)
e1:SetTarget(c18597560.target)
e1:SetOperation(c18597560.activate)
c:RegisterEffect(e1)
end
function c18597560.cfilter(c,tp)
return c:IsCode(70095154) and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c18597560.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c18597560.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c18597560.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c18597560.filter(c,e,tp)
return c:IsType(TYPE_FUSION) and aux.IsMaterialListSetCard(c,0x1093) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c18597560.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c18597560.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c18597560.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c18597560.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
tc:RegisterFlagEffect(18597560,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCondition(c18597560.descon)
e2:SetOperation(c18597560.desop)
e2:SetReset(RESET_PHASE+PHASE_END,2)
e2:SetCountLimit(1)
e2:SetLabel(Duel.GetTurnCount())
e2:SetLabelObject(tc)
Duel.RegisterEffect(e2,tp)
Duel.SpecialSummonComplete()
end
end
function c18597560.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(18597560)~=0
end
function c18597560.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
--青眼の混沌龍
function c20654247.initial_effect(c)
c:EnableReviveLimit()
--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.ritlimit)
c:RegisterEffect(e1)
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(aux.indoval)
c:RegisterEffect(e3)
--position
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(20654247,0))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCondition(c20654247.poscon)
e4:SetTarget(c20654247.postg)
e4:SetOperation(c20654247.posop)
c:RegisterEffect(e4)
end
function c20654247.poscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_RITUAL and mg:IsExists(Card.IsCode,1,nil,89631139)
end
function c20654247.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c20654247.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,nil)
local tc=tg:GetFirst()
while tc do
if Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 then
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)
end
tc=tg:GetNext()
end
if c:IsRelateToEffect(e) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_PIERCE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
end
end
--青き眼の激臨
function c29432790.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c29432790.cost)
e1:SetTarget(c29432790.target)
e1:SetOperation(c29432790.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(29432790,ACTIVITY_SUMMON,c29432790.counterfilter)
Duel.AddCustomActivityCounter(29432790,ACTIVITY_SPSUMMON,c29432790.counterfilter)
end
c29432790.card_code_list={89631139}
function c29432790.counterfilter(c)
return c:IsCode(89631139)
end
function c29432790.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(29432790,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(29432790,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c29432790.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c29432790.splimit(e,c)
return not c:IsCode(89631139)
end
function c29432790.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29432790.rmfilter(c)
return c:IsAbleToRemove() and not c:IsType(TYPE_TOKEN)
end
function c29432790.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c29432790.rmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c29432790.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and g:GetCount()>0 and Duel.GetMZoneCount(tp,g)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c29432790.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c29432790.rmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>3 then ft=3 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c29432790.spfilter,tp,LOCATION_DECK,0,1,ft,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--サイバー・ファロス
function c29719112.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c29719112.hspcon)
e1:SetOperation(c29719112.hspop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29719112,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c29719112.sptg)
e2:SetOperation(c29719112.spop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29719112,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetCountLimit(1,29719112)
e3:SetCost(aux.bfgcost)
e3:SetCondition(c29719112.thcon)
e3:SetTarget(c29719112.thtg)
e3:SetOperation(c29719112.thop)
c:RegisterEffect(e3)
end
function c29719112.spfilter(c,tp)
return c:IsRace(RACE_MACHINE)
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c29719112.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.CheckReleaseGroup(tp,c29719112.spfilter,1,nil,tp)
end
function c29719112.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,c29719112.spfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c29719112.spfilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c29719112.spfilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_MACHINE) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c29719112.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c29719112.spfilter2,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(c29719112.spfilter2,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 c29719112.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c29719112.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c29719112.spfilter2,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(c29719112.spfilter2,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.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c29719112.cfilter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
end
function c29719112.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c29719112.cfilter,1,nil,e,tp)
end
function c29719112.thfilter(c)
return c:IsCode(37630732) and c:IsAbleToHand()
end
function c29719112.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29719112.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c29719112.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c29719112.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 c41803903.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,41803903+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c41803903.target)
e1:SetOperation(c41803903.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c41803903.setcon)
e2:SetTarget(c41803903.settg)
e2:SetOperation(c41803903.setop)
c:RegisterEffect(e2)
end
function c41803903.thfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x10ec) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c41803903.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c41803903.spfilter(c,e,tp,hc)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x10ec)
and c:GetOriginalCode()~=hc:GetOriginalCode() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and Duel.GetLocationCountFromEx(tp,tp,hc,c)>0
end
function c41803903.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41803903.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c41803903.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local hc=Duel.SelectMatchingCard(tp,c41803903.thfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
if hc and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 and hc:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c41803903.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,hc)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end
function c41803903.filter2(c)
return c:IsSetCard(0x10ec) and c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
function c41803903.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp==1-tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
and Duel.IsExistingMatchingCard(c41803903.filter2,tp,LOCATION_EXTRA,0,1,nil)
end
function c41803903.setfilter(c)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c41803903.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41803903.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c41803903.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c41803903.setfilter,tp,LOCATION_DECK,0,nil)
local ct=math.min(Duel.GetLocationCount(tp,LOCATION_SZONE),g:GetCount())
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,ct,nil)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
end
--フォトン・チェンジ
function c42925441.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c42925441.target)
c:RegisterEffect(e1)
--effect
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(42925441,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1,42925441)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetRange(LOCATION_SZONE)
e4:SetCost(c42925441.effcost)
e4:SetTarget(c42925441.efftg)
e4:SetOperation(c42925441.effop)
c:RegisterEffect(e4)
end
function c42925441.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42925441,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c42925441.descon)
e1:SetOperation(c42925441.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
c:SetTurnCounter(0)
c:RegisterEffect(e1)
if c42925441.effcost(e,tp,eg,ep,ev,re,r,rp,0)
and c42925441.efftg(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.SelectYesNo(tp,94) then
c42925441.effcost(e,tp,eg,ep,ev,re,r,rp,1)
c42925441.efftg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetOperation(c42925441.effop)
end
end
function c42925441.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c42925441.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==2 then
Duel.Destroy(c,REASON_EFFECT)
end
end
function c42925441.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(42925441)==0 end
e:GetHandler():RegisterFlagEffect(42925441,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c42925441.costfilter1(c,e,tp)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c42925441.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalCode())
end
function c42925441.spfilter1(c,e,tp,code)
return c:IsSetCard(0x55) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c42925441.costfilter2(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsAbleToGraveAsCost()
end
function c42925441.thfilter(c)
return c:IsSetCard(0x55) and not c:IsCode(42925441) and c:IsAbleToHand()
end
function c42925441.costfilter3(c,e,tp)
return c:IsFaceup() and c:IsCode(93717133) and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c42925441.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalCode())
end
function c42925441.spfilter2(c,e,tp,code)
return c:IsSetCard(0x55) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c42925441.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c42925441.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c42925441.costfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c42925441.costfilter2,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c42925441.thfilter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
local b3=Duel.IsExistingMatchingCard(c42925441.costfilter3,tp,LOCATION_MZONE,0,1,nil,e,tp)
local op=0
if b1 and b2 and b3 then
op=Duel.SelectOption(tp,aux.Stringid(42925441,1),aux.Stringid(42925441,2),aux.Stringid(42925441,3))
elseif b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(42925441,1),aux.Stringid(42925441,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(42925441,1))
else
op=Duel.SelectOption(tp,aux.Stringid(42925441,2))+1
end
e:SetLabel(op)
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c42925441.costfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetValue(g:GetFirst():GetOriginalCode())
Duel.SendtoGrave(g,REASON_COST)
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
elseif op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c42925441.costfilter2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c42925441.costfilter3,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetValue(g:GetFirst():GetOriginalCode())
Duel.SendtoGrave(g,REASON_COST)
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function c42925441.effop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c42925441.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetValue())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
elseif op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c42925441.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
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c42925441.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetValue())
if g1:GetCount()>0 and Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c42925441.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g2:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
end
end
--フォトン・バニッシャー
function c43147039.initial_effect(c)
c:SetSPSummonOnce(43147039)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c43147039.sprcon)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(43147039,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,43147039)
e2:SetTarget(c43147039.thtg)
e2:SetOperation(c43147039.tgop)
c:RegisterEffect(e2)
--cannot attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetOperation(c43147039.atklimit)
c:RegisterEffect(e3)
--effect gain
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_MATERIAL)
e4:SetCondition(c43147039.effcon)
e4:SetOperation(c43147039.effop)
c:RegisterEffect(e4)
end
function c43147039.sprfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c43147039.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c43147039.sprfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c43147039.thfilter(c)
return c:IsCode(93717133) and c:IsAbleToHand()
end
function c43147039.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c43147039.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c43147039.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c43147039.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 c43147039.atklimit(e,tp,eg,ep,ev,re,r,rp)
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)
e:GetHandler():RegisterEffect(e1)
end
function c43147039.effcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end
function c43147039.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(43147039,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end
--魔界劇団のカーテンコール
function c4682617.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,4682617+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c4682617.condition)
e1:SetTarget(c4682617.target)
e1:SetOperation(c4682617.activate)
c:RegisterEffect(e1)
--activity check
Duel.AddCustomActivityCounter(4682617,ACTIVITY_CHAIN,c4682617.chainfilter)
end
function c4682617.chainfilter(re,tp,cid)
return not (re:IsActiveType(TYPE_SPELL) and re:GetHandler():IsSetCard(0x20ec))
end
function c4682617.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(4682617,tp,ACTIVITY_CHAIN)>0
end
function c4682617.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c4682617.spfilter(c,e,tp)
return c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c4682617.ctfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x20ec)
end
function c4682617.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c4682617.ctfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(c4682617.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c4682617.activate(e,tp,eg,ep,ev,re,r,rp)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c4682617.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
local ct=Duel.GetMatchingGroupCount(c4682617.ctfilter,tp,LOCATION_GRAVE,0,nil)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=Duel.SelectMatchingCard(tp,c4682617.thfilter,tp,LOCATION_EXTRA,0,1,ct,nil)
if hg:GetCount()>0 and Duel.SendtoHand(hg,nil,REASON_EFFECT)~=0 then
local sct=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,tp)
local sg=Duel.GetMatchingGroup(c4682617.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),sg:GetCount())
if sct>0 and ft>0 and Duel.SelectYesNo(tp,aux.Stringid(4682617,0)) then
Duel.BreakEffect()
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Group.CreateGroup()
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=sg:Select(tp,1,1,nil):GetFirst()
g:AddCard(tc)
sg:Remove(Card.IsCode,nil,tc:GetCode())
until sct==g:GetCount() or ft==g:GetCount() or not Duel.SelectYesNo(tp,210)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c4682617.splimit(e,c)
return not (c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM))
end
--グローウィング・ボウガン
function c53860621.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c53860621.target)
e1:SetOperation(c53860621.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(c53860621.eqlimit)
c:RegisterEffect(e2)
--atk/def up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetValue(500)
c:RegisterEffect(e4)
--discard
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(53860621,0))
e5:SetCategory(CATEGORY_HANDES)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_BATTLE_DESTROYING)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1,53860621)
e5:SetTarget(c53860621.destg)
e5:SetOperation(c53860621.desop)
c:RegisterEffect(e5)
--tohand
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(53860621,1))
e6:SetCategory(CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetCountLimit(1,53860622)
e6:SetCondition(c53860621.retcon)
e6:SetTarget(c53860621.rettg)
e6:SetOperation(c53860621.retop)
c:RegisterEffect(e6)
end
function c53860621.eqlimit(e,c)
return c:IsSetCard(0x33)
end
function c53860621.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x33)
end
function c53860621.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c53860621.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c53860621.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c53860621.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c53860621.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c53860621.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c53860621.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
function c53860621.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_SYNCHRO)
end
function c53860621.rettg(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 c53860621.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
--BF-フルアーマード・ウィング
function c54082269.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x33),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c54082269.efilter)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(aux.chainreg)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c54082269.acop)
c:RegisterEffect(e3)
--control
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(54082269,0))
e4:SetCategory(CATEGORY_CONTROL)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c54082269.cttg)
e4:SetOperation(c54082269.ctop)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(54082269,1))
e5:SetCategory(CATEGORY_RELEASE+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetCondition(c54082269.descon)
e5:SetTarget(c54082269.destg)
e5:SetOperation(c54082269.desop)
c:RegisterEffect(e5)
end
function c54082269.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c54082269.acop(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if not tc:IsRelateToEffect(re) or not re:IsActiveType(TYPE_MONSTER) or not tc:IsFaceup() or tc:GetCounter(0x1002)>0 then return end
local p,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
if p~=tp and loc==LOCATION_MZONE and e:GetHandler():GetFlagEffect(1)>0 then
tc:AddCounter(0x1002,1)
end
end
function c54082269.ctfilter(c)
return c:GetCounter(0x1002)>0 and c:IsControlerCanBeChanged()
end
function c54082269.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c54082269.ctfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c54082269.ctfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c54082269.ctfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c54082269.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp)
end
end
function c54082269.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c54082269.desfilter(c)
return c:GetCounter(0x1002)>0
end
function c54082269.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c54082269.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c54082269.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c54082269.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c54082269.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--サイバーロード・フュージョン
function c55704856.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,55704856+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c55704856.target)
e1:SetOperation(c55704856.activate)
c:RegisterEffect(e1)
end
function c55704856.filter0(c)
return (c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function c55704856.filter1(c,e)
return (c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c55704856.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and aux.IsMaterialListSetCard(c,0x1093) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c55704856.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function c55704856.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c55704856.filter0,tp,LOCATION_MZONE+LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(c55704856.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c55704856.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c55704856.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(c55704856.filter1,tp,LOCATION_MZONE+LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(c55704856.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c55704856.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(mat,nil,2,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,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
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(c55704856.ftarget)
e1:SetLabel(tc:GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c55704856.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
--強靭!無敵!最強!
function c56920308.initial_effect(c)
--effect gain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c56920308.target)
e1:SetOperation(c56920308.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(56920308,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,56920308)
e2:SetCondition(c56920308.setcon)
e2:SetTarget(c56920308.settg)
e2:SetOperation(c56920308.setop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
c56920308.card_code_list={89631139}
function c56920308.filter(c)
return c:IsFaceup() and c:IsSetCard(0xdd)
end
function c56920308.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c56920308.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c56920308.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c56920308.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c56920308.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_IMMUNE_EFFECT)
e1:SetValue(c56920308.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetCondition(c56920308.descon)
e3:SetOperation(c56920308.desop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
function c56920308.efilter(e,re)
return e:GetHandler()~=re:GetOwner()
end
function c56920308.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc and tc:IsRelateToBattle()
end
function c56920308.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
Duel.Hint(HINT_CARD,0,56920308)
Duel.Destroy(tc,REASON_EFFECT)
end
function c56920308.cfilter(c,tp)
return c:IsCode(89631139) and c:GetSummonPlayer()==tp
end
function c56920308.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c56920308.cfilter,1,nil,tp)
end
function c56920308.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c56920308.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsSSetable() then
Duel.SSet(tp,c)
Duel.ConfirmCards(1-tp,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
--ブルーアイズ・ソリッド・ドラゴン
function c57043986.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(57043986,0))
e1:SetCategory(CATEGORY_DISABLE)
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,57043986)
e1:SetTarget(c57043986.negtg)
e1:SetOperation(c57043986.negop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(57043986,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,57043987)
e3:SetCondition(c57043986.spcon)
e3:SetTarget(c57043986.sptg)
e3:SetOperation(c57043986.spop)
c:RegisterEffect(e3)
end
function c57043986.negfilter(c)
return c:IsType(TYPE_MONSTER) and aux.disfilter1(c)
end
function c57043986.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c57043986.negfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c57043986.negfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c57043986.negfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c57043986.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
end
end
function c57043986.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function c57043986.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c57043986.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToDeck()
and Duel.IsExistingMatchingCard(c57043986.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c57043986.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c57043986.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
end
--魔界劇場「ファンタスティックシアター」
function c77297908.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(77297908,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,77297908)
e2:SetCost(c77297908.thcost)
e2:SetTarget(c77297908.thtg)
e2:SetOperation(c77297908.thop)
c:RegisterEffect(e2)
--change effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(c77297908.chcon1)
e3:SetOperation(c77297908.chop1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_ACTIVATING)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,77297909)
e4:SetCondition(c77297908.chcon2)
e4:SetOperation(c77297908.chop2)
c:RegisterEffect(e4)
end
function c77297908.cfilter(c)
return c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and not c:IsPublic()
end
function c77297908.cfilter2(c,tp)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and not c:IsPublic()
and Duel.IsExistingMatchingCard(c77297908.cfilter3,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c77297908.cfilter3(c,code)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and not c:IsCode(code) and c:IsAbleToHand()
end
function c77297908.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c77297908.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c77297908.cfilter2,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g1=Duel.SelectMatchingCard(tp,c77297908.cfilter,tp,LOCATION_HAND,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,c77297908.cfilter2,tp,LOCATION_HAND,0,1,1,nil,tp)
e:SetLabel(g2:GetFirst():GetCode())
g1:Merge(g2)
Duel.ConfirmCards(1-tp,g1)
Duel.ShuffleHand(tp)
end
function c77297908.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c77297908.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c77297908.cfilter3,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c77297908.chcon1(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and re:IsActiveType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(c77297908.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c77297908.chop1(e,tp,eg,ep,ev,re,r,rp)
re:GetHandler():RegisterFlagEffect(77297908,RESET_CHAIN,0,1)
end
function c77297908.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c77297908.chcon2(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():GetFlagEffect(77297908)>0
and Duel.IsExistingMatchingCard(c77297908.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c77297908.chop2(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
return Duel.ChangeChainOperation(ev,c77297908.repop)
end
function c77297908.desfilter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c77297908.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,77297908)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c77297908.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--魔界劇団-メロー・マドンナ
function c78310590.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(78310590,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,78310590)
e1:SetCost(c78310590.thcost)
e1:SetTarget(c78310590.thtg)
e1:SetOperation(c78310590.thop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c78310590.val)
c:RegisterEffect(e2)
--spsummon (self)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(78310590,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,78310591)
e3:SetCondition(c78310590.spcon)
e3:SetTarget(c78310590.sptg)
e3:SetOperation(c78310590.spop)
c:RegisterEffect(e3)
--spsummon (deck)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(aux.chainreg)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(78310590,2))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,78310592)
e5:SetCondition(c78310590.spcon2)
e5:SetTarget(c78310590.sptg2)
e5:SetOperation(c78310590.spop2)
c:RegisterEffect(e5)
end
function c78310590.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c78310590.thfilter(c)
return c:IsSetCard(0x10ec) and not c:IsCode(78310590) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c78310590.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c78310590.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c78310590.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c78310590.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
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c78310590.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c78310590.splimit(e,c)
return not (c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM))
end
function c78310590.valfilter(c)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL)
end
function c78310590.val(e,c)
return Duel.GetMatchingGroupCount(c78310590.valfilter,c:GetControler(),LOCATION_GRAVE,0,nil)*100
end
function c78310590.cfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c78310590.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c78310590.cfilter,1,nil,tp)
end
function c78310590.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 c78310590.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 c78310590.spcon2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)and re:GetHandler():IsSetCard(0x20ec) and e:GetHandler():GetFlagEffect(1)>0
end
function c78310590.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c78310590.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c78310590.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c78310590.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c78310590.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local fid=c:GetFieldID()
tc:RegisterFlagEffect(78310590,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c78310590.thcon2)
e1:SetOperation(c78310590.thop2)
Duel.RegisterEffect(e1,tp)
end
end
function c78310590.thcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(78310590)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c78310590.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
--ブラック・バード・クローズ
function c80254726.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c80254726.condition)
e1:SetCost(c80254726.cost)
e1:SetTarget(c80254726.target)
e1:SetOperation(c80254726.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c80254726.handcon)
c:RegisterEffect(e2)
end
function c80254726.condition(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return ep~=tp and loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c80254726.discfilter(c)
return c:IsFaceup() and c:IsSetCard(0x33) and c:IsAbleToGraveAsCost()
end
function c80254726.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80254726.discfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c80254726.discfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c80254726.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c80254726.sfilter(c,e,tp)
return c:IsCode(9012916) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c80254726.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re)
and Duel.Destroy(eg,REASON_EFFECT)~=0 then
local sc=Duel.GetFirstMatchingCard(c80254726.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if sc and Duel.GetLocationCountFromEx(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(80254726,0)) then
Duel.BreakEffect()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c80254726.cfilter(c)
return c:IsFaceup() and ((c:IsSetCard(0x33) and c:IsType(TYPE_SYNCHRO)) or c:IsCode(9012916))
end
function c80254726.handcon(e)
return Duel.IsExistingMatchingCard(c80254726.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--エターナル・エヴォリューション・バースト
function c81193865.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c81193865.target)
e1:SetOperation(c81193865.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(c81193865.eqlimit)
c:RegisterEffect(e2)
--activate limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,1)
e3:SetCondition(c81193865.actcon)
e3:SetValue(c81193865.actlimit)
c:RegisterEffect(e3)
--chain attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(81193865,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c81193865.cacon)
e4:SetCost(c81193865.cacost)
e4:SetTarget(c81193865.catg)
e4:SetOperation(c81193865.caop)
c:RegisterEffect(e4)
if not c81193865.global_check then
c81193865.global_check=true
c81193865[0]=0
c81193865[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c81193865.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(c81193865.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c81193865.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffect(81193865)==0 then
c81193865[ep]=c81193865[ep]+1
tc:RegisterFlagEffect(81193865,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c81193865.clear(e,tp,eg,ep,ev,re,r,rp)
c81193865[0]=0
c81193865[1]=0
end
function c81193865.eqlimit(e,c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION)
end
function c81193865.eqfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION)
end
function c81193865.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c81193865.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c81193865.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c81193865.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c81193865.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c81193865.actcon(e)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()==e:GetHandler():GetControler() and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c81193865.actlimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function c81193865.cacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler():GetEquipTarget() and Duel.GetAttackTarget()~=nil
end
function c81193865.cafilter(c)
return c:IsSetCard(0x1093) and c:IsAbleToRemoveAsCost()
end
function c81193865.cacost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c81193865.cafilter,tp,LOCATION_GRAVE,0,1,nil)
and (c81193865[tp]==0 or c:GetEquipTarget():GetFlagEffect(81193865)~=0) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c81193865.ftarget)
e1:SetLabel(c:GetEquipTarget():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c81193865.cafilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c81193865.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c81193865.catg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and e:GetHandler():GetEquipTarget():IsChainAttackable(0,true) end
end
function c81193865.caop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
if not ec:IsRelateToBattle() then return end
Duel.ChainAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE+PHASE_DAMAGE_CAL)
ec:RegisterEffect(e1)
end
--BF-毒風のシムーン
function c81470373.initial_effect(c)
--search and normal summon / gy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81470373,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,81470373)
e1:SetCondition(c81470373.sumcon)
e1:SetCost(c81470373.sumcost)
e1:SetTarget(c81470373.sumtg)
e1:SetOperation(c81470373.sumop)
c:RegisterEffect(e1)
end
function c81470373.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c81470373.cfilter(c)
return c:IsSetCard(0x33) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c81470373.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c81470373.cfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c81470373.cfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c81470373.acfilter(c,tp)
return c:IsCode(91351370) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function c81470373.ttcon(e,c,minc)
if c==nil then return true end
return minc==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c81470373.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0
or not Duel.IsExistingMatchingCard(c81470373.acfilter,tp,LOCATION_DECK,0,1,nil,tp) then return false end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(c81470373.ttcon)
c:RegisterEffect(e1)
local res=c:IsSummonable(true,nil) or c:IsAbleToGrave()
e1:Reset()
return res
end
end
function c81470373.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c81470373.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c81470373.acfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetOperation(c81470373.tgop)
tc:RegisterEffect(e1)
if not c:IsRelateToEffect(e) then return end
Duel.BreakEffect()
--summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e2:SetCondition(c81470373.ttcon)
c:RegisterEffect(e2)
if c:IsSummonable(true,nil)
and (not c:IsAbleToGrave() or Duel.SelectYesNo(tp,aux.Stringid(81470373,1))) then
Duel.BreakEffect()
Duel.Summon(tp,c,true,nil)
else
Duel.BreakEffect()
Duel.SendtoGrave(c,REASON_EFFECT)
end
e2:Reset()
end
end
function c81470373.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_DARK) and c:IsLocation(LOCATION_EXTRA)
end
function c81470373.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoGrave(c,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_GRAVE) then
Duel.Damage(tp,1000,REASON_EFFECT)
end
end
--サイバー・エタニティ・ドラゴン
function c82315403.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunFun(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1093),aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),2,true)
--cannot target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c82315403.indcon)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--indes
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(82315403,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c82315403.spcon)
e3:SetTarget(c82315403.sptg)
e3:SetOperation(c82315403.spop)
c:RegisterEffect(e3)
--fusion protection
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(82315403,1))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCost(aux.bfgcost)
e4:SetOperation(c82315403.operation)
c:RegisterEffect(e4)
end
c82315403.material_setcode=0x1093
function c82315403.cfilter(c)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_MACHINE)
end
function c82315403.indcon(e)
return Duel.IsExistingMatchingCard(c82315403.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil)
end
function c82315403.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_FUSION) and rp==1-tp and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
end
function c82315403.spfilter(c,e,tp)
return c:IsCode(70095154) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c82315403.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c82315403.spfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE)
end
function c82315403.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(c82315403.spfilter),tp,LOCATION_DECK+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 c82315403.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c82315403.efftg)
e1:SetValue(aux.tgoval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(aux.indoval)
Duel.RegisterEffect(e2,tp)
end
function c82315403.efftg(e,c)
return c:IsType(TYPE_FUSION)
end
--フォトン・オービタル
function c89132148.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(89132148,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetTarget(c89132148.eqtg)
e1:SetOperation(c89132148.eqop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(89132148,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,89132148)
e2:SetCondition(c89132148.thcon)
e2:SetCost(c89132148.thcost)
e2:SetTarget(c89132148.thtg)
e2:SetOperation(c89132148.thop)
c:RegisterEffect(e2)
end
function c89132148.filter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c89132148.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc~=c and c89132148.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c89132148.filter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c89132148.filter,tp,LOCATION_MZONE,0,1,1,c)
end
function c89132148.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not tc:IsControler(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c89132148.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
--Indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3)
end
function c89132148.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c89132148.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget()
end
function c89132148.thcost(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 c89132148.thfilter(c)
return (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsType(TYPE_MONSTER) and not c:IsCode(89132148) and c:IsAbleToHand()
end
function c89132148.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c89132148.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c89132148.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c89132148.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
--ビンゴマシーンGO!GO!
function c93437091.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,93437091+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c93437091.thtg)
e1:SetOperation(c93437091.thop)
c:RegisterEffect(e1)
end
c93437091.card_code_list={89631139,23995346}
function c93437091.thfilter(c)
return (((aux.IsCodeListed(c,89631139) or aux.IsCodeListed(c,23995346)) and not c:IsCode(93437091) and c:IsType(TYPE_SPELL+TYPE_TRAP))
or (c:IsSetCard(0xdd) and c:IsType(TYPE_MONSTER))) and c:IsAbleToHand()
end
function c93437091.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c93437091.thfilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c93437091.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c93437091.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,3,3,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tg=sg:RandomSelect(1-tp,1)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment