Commit 98ec2ede authored by mercury233's avatar mercury233

rm

parent 72fc4d6e
#created by ...
#main
100409001
100409002
100409003
100409004
100409005
100409013
100409014
100409015
100409016
100409024
100409025
100409026
100409027
100409035
100409036
100409037
100409038
100409045
100409046
100409047
100409048
100409049
#extra
100409012
100409023
100409034
!side
--魔界の警邏課デスポリス
--Police Patrol of the Underworld
--Script by nekrozar
function c100200149.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,2)
--counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c100200149.regcon)
e1:SetOperation(c100200149.regop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c100200149.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100200149,0))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100200149)
e3:SetCondition(c100200149.ctcon)
e3:SetCost(c100200149.ctcost)
e3:SetTarget(c100200149.cttg)
e3:SetOperation(c100200149.ctop)
c:RegisterEffect(e3)
end
function c100200149.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and e:GetLabel()==1
end
function c100200149.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(100200149,RESET_EVENT+RESETS_STANDARD,0,0)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(100200149,1))
end
function c100200149.valcheck(e,c)
local g=c:GetMaterial()
if g:GetClassCount(Card.GetLinkCode)==g:GetCount() and g:IsExists(Card.IsLinkAttribute,2,nil,ATTRIBUTE_DARK) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c100200149.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(100200149)~=0
end
function c100200149.cfilter(c)
return Duel.IsExistingTarget(Card.IsCanAddCounter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,0x1049,1)
end
function c100200149.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100200149.cfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c100200149.cfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c100200149.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsCanAddCounter(0x1049,1) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,0x1049,1)
end
function c100200149.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
tc:AddCounter(0x1049,1)
if tc:GetFlagEffect(100200249)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetTarget(c100200149.reptg)
e1:SetOperation(c100200149.repop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(100200249,RESET_EVENT+RESETS_STANDARD,0,0)
end
end
function c100200149.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 c:IsCanRemoveCounter(tp,0x1049,1,REASON_EFFECT) end
return true
end
function c100200149.repop(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveCounter(tp,0x1049,1,REASON_EFFECT)
end
--アストラグールズ
--Astra Ghouls
--Script by nekrozar
function c100231007.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100231007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c100231007.sptg)
e1:SetOperation(c100231007.spop)
c:RegisterEffect(e1)
--dice
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100231007,1))
e2:SetCategory(CATEGORY_DICE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c100231007.dctg)
e2:SetOperation(c100231007.dcop)
c:RegisterEffect(e2)
end
function c100231007.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100231007.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100231007.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100231007.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100231007.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100231007.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) 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)
local fid=c:GetFieldID()
tc:RegisterFlagEffect(100231007,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetLabel(fid)
e3:SetLabelObject(tc)
e3:SetCondition(c100231007.rmcon)
e3:SetOperation(c100231007.rmop)
Duel.RegisterEffect(e3,tp)
end
Duel.SpecialSummonComplete()
end
function c100231007.rmcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(100231007)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c100231007.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetLabelObject(),POS_FACEUP,REASON_EFFECT)
end
function c100231007.dcfilter(c)
return c:IsFaceup() and c:IsLevelAbove(1)
end
function c100231007.dctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100231007.dcfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c100231007.dcop(e,tp,eg,ep,ev,re,r,rp)
local dc=Duel.TossDice(tp,1)
local g=Duel.GetMatchingGroup(c100231007.dcfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_LEVEL_FINAL)
e1:SetValue(dc)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--レイン・ボーズ
--Rain Bozu
--Script by nekrozar
function c100231008.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100231008,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100231008.atkcon1)
e1:SetTarget(c100231008.atktg1)
e1:SetOperation(c100231008.atkop1)
c:RegisterEffect(e1)
--atk/def
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:SetCondition(c100231008.atkcon2)
e2:SetValue(c100231008.atkval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
e3:SetCondition(c100231008.defcon)
c:RegisterEffect(e3)
--to defense
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_BATTLE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c100231008.poscon)
e4:SetOperation(c100231008.posop)
c:RegisterEffect(e4)
--pendulum
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100231008,1))
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_DESTROYED)
e5:SetCondition(c100231008.pencon)
e5:SetTarget(c100231008.pentg)
e5:SetOperation(c100231008.penop)
c:RegisterEffect(e5)
end
function c100231008.atkcon1(e,tp,eg,ep,ev,re,r,rp)
return math.abs(Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA))>0
end
function c100231008.atktg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100231008.atkop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
local atk=math.abs(Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA))
if tc:IsFaceup() and tc:IsRelateToEffect(e) and atk>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c100231008.atkcon2(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function c100231008.atkval(e,c)
local tp=c:GetControler()
return math.abs(Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA))*200
end
function c100231008.defcon(e)
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer()
end
function c100231008.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetAttackedCount()>0
end
function c100231008.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 c100231008.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c100231008.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c100231008.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
--ベルキャットファイター
--Script by nekrozar
function c100231009.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,3,3,c100231009.lcheck)
c:EnableReviveLimit()
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100231009,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(aux.bdocon)
e1:SetTarget(c100231009.tktg)
e1:SetOperation(c100231009.tkop)
c:RegisterEffect(e1)
end
function c100231009.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_TOKEN)
end
function c100231009.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,100231109,0,0x4011,2000,2000,4,RACE_MACHINE,ATTRIBUTE_WIND) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c100231009.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,100231109,0,0x4011,2000,2000,4,RACE_MACHINE,ATTRIBUTE_WIND) then return end
local token=Duel.CreateToken(tp,100231109)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
--リンク・パーティー
--Link Party
--Script by nekrozar
function c100231010.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_RECOVER+CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100231010+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100231010.target)
e1:SetOperation(c100231010.activate)
c:RegisterEffect(e1)
end
function c100231010.filter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c100231010.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroup(c100231010.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil):GetClassCount(Card.GetAttribute)
if chk==0 then return (ct==1 and Duel.IsExistingMatchingCard(c100231010.filter,tp,LOCATION_MZONE,0,1,nil))
or (ct==2 and Duel.IsExistingMatchingCard(c100231010.filter,tp,0,LOCATION_MZONE,1,nil))
or ct==3 or ct==4
or (ct==5 and Duel.IsExistingMatchingCard(c100231010.spfilter,tp,LOCATION_DECK,0,1,nil))
or (ct==6 and Duel.IsExistingMatchingCard(c100231010.desfilter,tp,0,LOCATION_MZONE,1,nil)) end
if ct==3 then
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
elseif ct==4 then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2000)
elseif ct==5 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
elseif ct==6 then
local g=Duel.GetMatchingGroup(c100231010.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
end
function c100231010.spfilter(c,e,tp)
return c:IsAttackAbove(2500) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100231010.desfilter(c)
return c:IsFaceup() and c:IsAttackBelow(3000)
end
function c100231010.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroup(c100231010.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil):GetClassCount(Card.GetAttribute)
local g1=Duel.GetMatchingGroup(c100231010.filter,tp,LOCATION_MZONE,0,nil)
if ct==1 and g1:GetCount()>0 then
local tc1=g1:GetFirst()
while tc1 do
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)
tc1:RegisterEffect(e1)
tc1=g1:GetNext()
end
end
local g2=Duel.GetMatchingGroup(c100231010.filter,tp,0,LOCATION_MZONE,nil)
if ct==2 and g2:GetCount()>0 then
Duel.BreakEffect()
local tc2=g2:GetFirst()
while tc2 do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
tc2=g2:GetNext()
end
end
if ct==3 then
Duel.BreakEffect()
Duel.Recover(tp,1500,REASON_EFFECT)
end
if ct==4 then
Duel.BreakEffect()
Duel.Damage(1-tp,2000,REASON_EFFECT)
end
local g3=Duel.GetMatchingGroup(c100231010.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if ct==5 and g3:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g3:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
local g4=Duel.GetMatchingGroup(c100231010.desfilter,tp,0,LOCATION_MZONE,nil)
if ct==6 and g4:GetCount()>0 then
Duel.BreakEffect()
Duel.Destroy(g4,REASON_EFFECT)
end
end
--ペア・ルック
--Script by nekrozar
function c100231011.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c100231011.target)
e1:SetOperation(c100231011.activate)
c:RegisterEffect(e1)
end
function c100231011.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g1=Duel.GetDecktopGroup(tp,1)
local tc1=g1:GetFirst()
local g2=Duel.GetDecktopGroup(1-tp,1)
local tc2=g2:GetFirst()
return tc1 and tc2 and tc1:IsAbleToRemove() and tc2:IsAbleToRemove() and tc1:IsAbleToHand() and tc2:IsAbleToHand()
end
end
function c100231011.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 or Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end
Duel.ConfirmDecktop(tp,1)
Duel.ConfirmDecktop(1-tp,1)
local g1=Duel.GetDecktopGroup(tp,1)
local tc1=g1:GetFirst()
local g2=Duel.GetDecktopGroup(1-tp,1)
local tc2=g2:GetFirst()
if bit.band(tc1:GetType(),0x7)==bit.band(tc2:GetType(),0x7) then
Duel.DisableShuffleCheck()
Duel.SendtoHand(tc1,nil,REASON_EFFECT)
Duel.SendtoHand(tc2,nil,REASON_EFFECT)
Duel.ShuffleHand(tp)
Duel.ShuffleHand(1-tp)
else
Duel.DisableShuffleCheck()
Duel.Remove(tc1,POS_FACEUP,REASON_EFFECT)
Duel.Remove(tc2,POS_FACEUP,REASON_EFFECT)
end
end
--デーモンの顕現
--Script by nekrozar
function c100242201.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,70781052,aux.FilterBoolFunction(Card.IsFusionAttribute,ATTRIBUTE_DARK),1,true,true)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(70781052)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsCode,70781052))
e2:SetValue(500)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100242201,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(c100242201.spcon)
e3:SetTarget(c100242201.sptg)
e3:SetOperation(c100242201.spop)
c:RegisterEffect(e3)
end
function c100242201.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_FUSION)
and rp==1-tp and c:GetPreviousControler()==tp
end
function c100242201.spfilter(c,e,tp)
return c:IsCode(70781052) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100242201.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100242201.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c100242201.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(c100242201.spfilter),tp,LOCATION_HAND+LOCATION_DECK+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
--レイテンシ
--Latency
--Script by dest
function c100334001.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100334001,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,100334001)
e1:SetCondition(c100334001.spcon)
e1:SetTarget(c100334001.sptg)
e1:SetOperation(c100334001.spop)
c:RegisterEffect(e1)
end
function c100334001.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,REASON_EFFECT)~=0 and c:IsPreviousLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp
end
function c100334001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100334001.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100334001,1))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCountLimit(1,100334001+100)
e1:SetCondition(c100334001.drcon)
e1:SetTarget(c100334001.drtg)
e1:SetOperation(c100334001.drop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_LEAVE-RESET_TOGRAVE)
c:RegisterEffect(e1)
end
end
function c100334001.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_LINK
end
function c100334001.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100334001.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--スワップリースト
--Swap Cleric
--Script by dest
function c100334002.initial_effect(c)
--reduce atk and draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100334002,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCountLimit(1,100334002)
e1:SetCondition(c100334002.drcon)
e1:SetTarget(c100334002.drtg)
e1:SetOperation(c100334002.drop)
c:RegisterEffect(e1)
--reg
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c100334002.drcon)
e2:SetOperation(c100334002.regop)
c:RegisterEffect(e2)
end
function c100334002.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_LINK
end
function c100334002.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and rc:IsAttackAbove(500) and rc:GetFlagEffect(100334002)~=0 end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100334002.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if not rc:IsAttackAbove(500) or rc:IsImmuneToEffect(e) or rc:GetFlagEffect(100334002)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1)
if not rc:IsHasEffect(EFFECT_REVERSE_UPDATE) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c100334002.regop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
rc:RegisterFlagEffect(100334002,RESET_EVENT+RESETS_STANDARD,0,1)
end
--デフコンバード
--Defcon Bird
--Script by dest
function c100334003.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100334003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100334003)
e1:SetCost(c100334003.spcost)
e1:SetTarget(c100334003.sptg)
e1:SetOperation(c100334003.spop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100334003,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c100334003.condition)
e2:SetTarget(c100334003.target)
e2:SetOperation(c100334003.opetation)
c:RegisterEffect(e2)
end
function c100334003.cfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsDiscardable()
end
function c100334003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100334003.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c100334003.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c100334003.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 c100334003.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 c100334003.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
return at and at:IsControler(tp) and at:IsFaceup() and at:IsRace(RACE_CYBERSE)
end
function c100334003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.GetAttackTarget():CreateEffectRelation(e)
end
function c100334003.opetation(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
if at:IsRelateToEffect(e) and at:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(at:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
at:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(at:GetBaseAttack()*2)
at:RegisterEffect(e2)
if at:IsAttackPos() and at:IsCanChangePosition() and Duel.SelectYesNo(tp,aux.Stringid(100334003,2)) then
Duel.BreakEffect()
Duel.ChangePosition(at,POS_FACEUP_DEFENSE)
end
end
end
--マイクロ・コーダー
--Micro Coder
--Script by nekrozar
function c100334004.initial_effect(c)
--temp
if EFFECT_EXTRA_LINK_MATERIAL==nil then
EFFECT_EXTRA_LINK_MATERIAL=358
function Auxiliary.LExtraFilter(c,f,lc)
if c:IsLocation(LOCATION_ONFIELD) and not c:IsFaceup() then return false end
return c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL) and c:IsCanBeLinkMaterial(lc) and (not f or f(c))
end
function Auxiliary.GetLinkCount(c)
if c:IsType(TYPE_LINK) and c:GetLink()>1 then
return 1+0x10000*c:GetLink()
else return 1 end
end
function Auxiliary.GetLinkMaterials(tp,f,lc)
local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f,lc)
local mg2=Duel.GetMatchingGroup(Auxiliary.LExtraFilter,tp,LOCATION_HAND+LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc)
if mg2:GetCount()>0 then mg:Merge(mg2) end
return mg
end
function Auxiliary.LCheckOtherMaterial(c,mg,lc)
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL)}
for _,te in pairs(le) do
local f=te:GetValue()
if f and not f(te,lc,mg) then return false end
end
return true
end
function Auxiliary.LUncompatibilityFilter(c,sg,lc)
local mg=sg:Filter(aux.TRUE,c)
return not Auxiliary.LCheckOtherMaterial(c,mg,lc)
end
function Auxiliary.LCheckRecursive(c,tp,sg,mg,lc,ct,minc,maxc,gf)
sg:AddCard(c)
ct=ct+1
local res=Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
or ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc,gf)
sg:RemoveCard(c)
ct=ct-1
return res
end
function Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
return ct>=minc and sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg))
and not sg:IsExists(Auxiliary.LUncompatibilityFilter,1,nil,sg,lc)
end
function Auxiliary.LinkCondition(f,minc,maxc,gf)
return function(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Auxiliary.GetLinkMaterials(tp,f,c)
local sg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_LMATERIAL)
if sg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
local ct=sg:GetCount()
if ct>maxc then return false end
return Auxiliary.LCheckGoal(tp,sg,c,minc,ct,gf)
or mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,c,ct,minc,maxc,gf)
end
end
function Auxiliary.LinkTarget(f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c)
local mg=Auxiliary.GetLinkMaterials(tp,f,c)
local bg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_LMATERIAL)
if #bg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
bg:Select(tp,#bg,#bg,nil)
end
local sg=Group.CreateGroup()
sg:Merge(bg)
local finish=false
while #sg<maxc do
finish=Auxiliary.LCheckGoal(tp,sg,c,minc,#sg,gf)
local cg=mg:Filter(Auxiliary.LCheckRecursive,sg,tp,sg,mg,c,#sg,minc,maxc,gf)
if #cg==0 then break end
local cancel=not finish
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local tc=cg:SelectUnselect(sg,tp,finish,cancel,minc,maxc)
if not tc then break end
if not bg:IsContains(tc) then
if not sg:IsContains(tc) then
sg:AddCard(tc)
if #sg==maxc then finish=true end
else
sg:RemoveCard(tc)
end
elseif #bg>0 and #sg<=#bg then
return false
end
end
if finish then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
end
end
--hand link
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c100334004.matcon)
e1:SetValue(c100334004.matval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c100334004.ctcon)
e2:SetOperation(c100334004.ctop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100334004,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,100334004)
e3:SetCondition(c100334004.thcon)
e3:SetTarget(c100334004.thtg)
e3:SetOperation(c100334004.thop)
c:RegisterEffect(e3)
end
function c100334004.matcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100334004)==0
end
function c100334004.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
end
function c100334004.matval(e,c,mg)
return c:IsSetCard(0x101) and mg:IsExists(c100334004.mfilter,1,nil)
end
function c100334004.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c100334004.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,100334004,RESET_PHASE+PHASE_END,0,1)
end
function c100334004.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
e:SetLabel(0)
if c:IsPreviousLocation(LOCATION_ONFIELD) then e:SetLabel(1) end
return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD+LOCATION_HAND) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0x101)
end
function c100334004.thfilter(c,chk)
return ((c:IsSetCard(0x218) and c:IsType(TYPE_SPELL+TYPE_TRAP)) or (chk==1 and c:IsRace(RACE_CYBERSE) and c:IsLevel(4))) and c:IsAbleToHand()
end
function c100334004.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100334004.thfilter,tp,LOCATION_DECK,0,1,nil,e:GetLabel()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100334004.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100334004.thfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel())
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--プロフィビット・スネーク
--Profibit Snake
--Script by dest
function c100334005.initial_effect(c)
--opp to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100334005,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_START)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100334005)
e1:SetCondition(c100334005.thcon)
e1:SetCost(c100334005.thcost)
e1:SetTarget(c100334005.thtg)
e1:SetOperation(c100334005.thop)
c:RegisterEffect(e1)
--GY to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100334005,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100334005+100)
e2:SetCondition(c100334005.thcon2)
e2:SetCost(c100334005.thcost2)
e2:SetTarget(c100334005.thtg2)
e2:SetOperation(c100334005.thop2)
c:RegisterEffect(e2)
end
function c100334005.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
if not bc then return false end
if tc:IsControler(1-tp) then tc,bc=bc,tc end
e:SetLabelObject(bc)
return tc:IsFaceup() and tc:IsRace(RACE_CYBERSE) and tc:IsType(TYPE_LINK)
end
function c100334005.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 c100334005.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return bc:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,bc,1,0,0)
end
function c100334005.thop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() and bc:IsControler(1-tp) then
Duel.SendtoHand(bc,nil,REASON_EFFECT)
end
end
function c100334005.thcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local bc=tc:GetBattleTarget()
return eg:GetCount()==1 and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
and bc:IsRelateToBattle() and bc:IsControler(tp) and bc:IsRace(RACE_CYBERSE)
end
function c100334005.cfilter(c,tp)
return c:IsAbleToRemoveAsCost() and Duel.IsExistingTarget(c100334005.thfilter,tp,LOCATION_GRAVE,0,1,c)
end
function c100334005.thfilter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE) and c:IsAbleToHand()
end
function c100334005.thcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100334005.cfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100334005.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100334005.thtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100334005.thfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100334005.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100334005.thop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--コード・ラジエーター
--Code Radiator
--Script by nekrozar
function c100334006.initial_effect(c)
--temp
if EFFECT_EXTRA_LINK_MATERIAL==nil then
EFFECT_EXTRA_LINK_MATERIAL=358
function Auxiliary.LExtraFilter(c,f,lc)
if c:IsLocation(LOCATION_ONFIELD) and not c:IsFaceup() then return false end
return c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL) and c:IsCanBeLinkMaterial(lc) and (not f or f(c))
end
function Auxiliary.GetLinkCount(c)
if c:IsType(TYPE_LINK) and c:GetLink()>1 then
return 1+0x10000*c:GetLink()
else return 1 end
end
function Auxiliary.GetLinkMaterials(tp,f,lc)
local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f,lc)
local mg2=Duel.GetMatchingGroup(Auxiliary.LExtraFilter,tp,LOCATION_HAND+LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc)
if mg2:GetCount()>0 then mg:Merge(mg2) end
return mg
end
function Auxiliary.LCheckOtherMaterial(c,mg,lc)
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL)}
for _,te in pairs(le) do
local f=te:GetValue()
if f and not f(te,lc,mg) then return false end
end
return true
end
function Auxiliary.LUncompatibilityFilter(c,sg,lc)
local mg=sg:Filter(aux.TRUE,c)
return not Auxiliary.LCheckOtherMaterial(c,mg,lc)
end
function Auxiliary.LCheckRecursive(c,tp,sg,mg,lc,ct,minc,maxc,gf)
sg:AddCard(c)
ct=ct+1
local res=Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
or ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc,gf)
sg:RemoveCard(c)
ct=ct-1
return res
end
function Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
return ct>=minc and sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg))
and not sg:IsExists(Auxiliary.LUncompatibilityFilter,1,nil,sg,lc)
end
function Auxiliary.LinkCondition(f,minc,maxc,gf)
return function(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Auxiliary.GetLinkMaterials(tp,f,c)
local sg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_LMATERIAL)
if sg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
local ct=sg:GetCount()
if ct>maxc then return false end
return Auxiliary.LCheckGoal(tp,sg,c,minc,ct,gf)
or mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,c,ct,minc,maxc,gf)
end
end
function Auxiliary.LinkTarget(f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c)
local mg=Auxiliary.GetLinkMaterials(tp,f,c)
local bg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_LMATERIAL)
if #bg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
bg:Select(tp,#bg,#bg,nil)
end
local sg=Group.CreateGroup()
sg:Merge(bg)
local finish=false
while #sg<maxc do
finish=Auxiliary.LCheckGoal(tp,sg,c,minc,#sg,gf)
local cg=mg:Filter(Auxiliary.LCheckRecursive,sg,tp,sg,mg,c,#sg,minc,maxc,gf)
if #cg==0 then break end
local cancel=not finish
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local tc=cg:SelectUnselect(sg,tp,finish,cancel,minc,maxc)
if not tc then break end
if not bg:IsContains(tc) then
if not sg:IsContains(tc) then
sg:AddCard(tc)
if #sg==maxc then finish=true end
else
sg:RemoveCard(tc)
end
elseif #bg>0 and #sg<=#bg then
return false
end
end
if finish then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
end
end
--hand link
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c100334006.matcon)
e1:SetValue(c100334006.matval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c100334006.ctcon)
e2:SetOperation(c100334006.ctop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100334006,0))
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,100334006)
e3:SetCondition(c100334006.discon)
e3:SetTarget(c100334006.distg)
e3:SetOperation(c100334006.disop)
c:RegisterEffect(e3)
end
function c100334006.matcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100334006)==0
end
function c100334006.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
end
function c100334006.matval(e,c,mg)
return c:IsSetCard(0x101) and mg:IsExists(c100334006.mfilter,1,nil)
end
function c100334006.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c100334006.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,100334006,RESET_PHASE+PHASE_END,0,1)
end
function c100334006.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
e:SetLabel(0)
if c:IsPreviousLocation(LOCATION_ONFIELD) then e:SetLabel(1) end
return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD+LOCATION_HAND) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0x101)
end
function c100334006.disfilter(c)
return c:IsFaceup() and not (c:IsAttack(0) and c:IsDisabled())
end
function c100334006.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c100334006.disfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100334006.disfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100334006.disfilter,tp,0,LOCATION_MZONE,1,1+e:GetLabel(),nil)
end
function c100334006.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
for tc in aux.Next(g) do
if tc:IsFaceup() and tc:IsRelateToEffect(e) 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)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
end
end
--スプール・コード
--Spool Code
--Script by dest
function c100334022.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c100334022.condition)
e1:SetOperation(c100334022.activate)
c:RegisterEffect(e1)
end
function c100334022.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsControler(1-tp) and Duel.GetAttackTarget()==nil
and Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,3,nil,RACE_CYBERSE)
end
function c100334022.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),3)
if Duel.NegateAttack() and ft>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,100334122,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT,POS_FACEUP_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(100334022,0)) then
Duel.BreakEffect()
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
repeat
local token=Duel.CreateToken(tp,100334122)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e1,true)
ft=ft-1
until ft==0 or not Duel.SelectYesNo(tp,210)
Duel.SpecialSummonComplete()
end
end
--サイバネット・オプティマイズ
--Cynet Optimize
--Script by dest
function c100334023.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100334023,0))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100334023)
e2:SetTarget(c100334023.sumtg)
e2:SetOperation(c100334023.sumop)
c:RegisterEffect(e2)
--actlimit
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(c100334023.actcon)
e3:SetValue(c100334023.aclimit)
c:RegisterEffect(e3)
end
function c100334023.sumfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsSummonable(true,nil)
end
function c100334023.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100334023.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c100334023.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c100334023.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100334023.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100334023.splimit(e,c)
return not c:IsRace(RACE_CYBERSE) and c:IsLocation(LOCATION_EXTRA)
end
function c100334023.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x101) and c:IsControler(tp)
end
function c100334023.actcon(e)
local tp=e:GetHandlerPlayer()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return (a and c100334023.cfilter(a,tp)) or (d and c100334023.cfilter(d,tp))
end
function c100334023.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
--サイバネット・コーデック
--Cynet Codec
--Script by dest
function c100334024.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100334024,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c100334024.thcon)
e2:SetTarget(c100334024.thtg)
e2:SetOperation(c100334024.thop)
c:RegisterEffect(e2)
if not c100334024.global_check then
c100334024.global_check=true
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e3:SetOperation(c100334024.clear)
Duel.RegisterEffect(e3,0)
end
end
c100334024.attlimit=0
function c100334024.clear(e,tp,eg,ep,ev,re,r,rp)
c100334024.attlimit=0
end
function c100334024.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x101) and c:IsControler(tp) and bit.band(c:GetSummonLocation(),LOCATION_EXTRA)~=0
end
function c100334024.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100334024.cfilter,1,nil,tp)
end
function c100334024.tgfilter(c,tp,eg)
return eg:IsContains(c) and Duel.IsExistingMatchingCard(c100334024.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetAttribute())
end
function c100334024.thfilter(c,att)
local lim=c100334024.attlimit
return c:IsRace(RACE_CYBERSE) and c:IsAttribute(att) and (lim==0 or not c:IsAttribute(lim)) and c:IsAbleToHand()
end
function c100334024.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100334024.tgfilter(chkc,tp,eg) end
if chk==0 then return Duel.IsExistingTarget(c100334024.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,eg)
and Duel.GetFlagEffect(tp,100334024)==0 end
Duel.RegisterFlagEffect(tp,100334024,RESET_CHAIN,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c100334024.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,eg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100334024.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local att=tc:GetAttribute()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100334024.thfilter,tp,LOCATION_DECK,0,1,1,nil,att)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
c100334024.attlimit=c100334024.attlimit+att
end
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(c100334024.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100334024.splimit(e,c)
return not c:IsRace(RACE_CYBERSE) and c:IsLocation(LOCATION_EXTRA)
end
--サイバネット・コンフリクト
--Cynet Conflict
--Script by dest
function c100334032.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,100334032+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100334032.condition)
e1:SetTarget(c100334032.target)
e1:SetOperation(c100334032.activate)
c:RegisterEffect(e1)
end
function c100334032.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x101)
end
function c100334032.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100334032.cfilter,tp,LOCATION_MZONE,0,1,nil)
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function c100334032.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function c100334032.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if Duel.NegateActivation(ev) and tc:IsRelateToEffect(re) and Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c100334032.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
function c100334032.aclimit(e,re,tp)
local c=re:GetHandler()
local tc=e:GetLabelObject()
return c:GetOriginalCode()==tc:GetOriginalCode() and not c:IsImmuneToEffect(e)
end
--シューティングコード・トーカー
--Shootingcode Talker
--Script by mercury233
function c100334041.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_CYBERSE),2)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100334041,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100334041.condition)
e1:SetTarget(c100334041.target)
e1:SetOperation(c100334041.operation)
c:RegisterEffect(e1)
--destroy reg
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetOperation(c100334041.regop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c100334041.drtg)
e3:SetOperation(c100334041.drop)
c:RegisterEffect(e3)
end
function c100334041.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100334041.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetLinkedGroupCount()>0 end
end
function c100334041.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(e:GetHandler():GetLinkedGroupCount())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c100334041.atkcon)
e2:SetValue(-400)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
function c100334041.atkcon(e)
if not Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL then return false end
local tp=e:GetHandlerPlayer()
local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
if #g~=1 then return false end
local c=e:GetHandler()
local bc=g:GetFirst()
return (c==Duel.GetAttacker() and bc==Duel.GetAttackTarget()) or (bc==Duel.GetAttacker() and c==Duel.GetAttackTarget())
end
function c100334041.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToBattle() then return end
local ct=c:GetFlagEffectLabel(100334041)
if ct then
c:SetFlagEffectLabel(100334041,ct+1)
else
c:RegisterFlagEffect(100334041,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,1)
end
end
function c100334041.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetFlagEffectLabel(100334041)
if chk==0 then return ct and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c100334041.drop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetFlagEffectLabel(100334041)
Duel.Draw(tp,ct,REASON_EFFECT)
end
--エルフェーズ
--Elphase
--Script by mercury233
function c100334042.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c100334042.mfilter,2)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c100334042.atkval)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100334042,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100334042)
e2:SetCondition(c100334042.spcon)
e2:SetTarget(c100334042.sptg)
e2:SetOperation(c100334042.spop)
c:RegisterEffect(e2)
end
function c100334042.mfilter(c)
return c:IsLevelAbove(3) and c:IsLinkRace(RACE_CYBERSE)
end
function c100334042.atkval(e,c)
return c:GetLinkedGroupCount()*300
end
function c100334042.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and c:IsPreviousPosition(POS_FACEUP)
end
function c100334042.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100334042.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100334042.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100334042.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100334042.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100334042.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetValue(1)
tc:RegisterEffect(e3)
Duel.SpecialSummonComplete()
end
end
--トークバック・ランサー
--Talkback Lancer
--Script by mercury233
function c100334043.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c100334043.matfilter,1,1)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100334043,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100334043)
e1:SetCost(c100334043.spcost)
e1:SetTarget(c100334043.sptg)
e1:SetOperation(c100334043.spop)
c:RegisterEffect(e1)
end
function c100334043.matfilter(c)
return c:IsLevelBelow(2) and c:IsLinkRace(RACE_CYBERSE)
end
function c100334043.cfilter(c,e,tp,zone)
return c:IsRace(RACE_CYBERSE) and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_TOFIELD,zone)>0
and Duel.IsExistingTarget(c100334043.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetOriginalCode())
end
function c100334043.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local zone=c:GetLinkedZone(tp)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100334043.cfilter,1,c,e,tp,zone) end
local g=Duel.SelectReleaseGroup(tp,c100334043.cfilter,1,1,c,e,tp,zone)
Duel.Release(g,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function c100334043.spfilter(c,e,tp,code)
return c:IsSetCard(0x101) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100334043.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local cc=e:GetLabelObject()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp)
and chkc~=cc and c100334043.spfilter(chkc,e,tp,cc:GetOriginalCode()) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100334043.spfilter,tp,LOCATION_GRAVE,0,1,1,cc,e,tp,cc:GetOriginalCode())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100334043.spop(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
--青眼の混沌龍
--Blue-Eyes Chaos Dragon
--Script by nekrozar
function c100409001.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(100409001,0))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCondition(c100409001.poscon)
e4:SetTarget(c100409001.postg)
e4:SetOperation(c100409001.posop)
c:RegisterEffect(e4)
end
function c100409001.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 c100409001.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 c100409001.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
--ブルーアイズ・ソリッド・ドラゴン
--Blue-Eyes Solid Dragon
--Script by dest
function c100409002.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100409002,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,100409002)
e1:SetTarget(c100409002.negtg)
e1:SetOperation(c100409002.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(100409002,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100409002+100)
e3:SetCondition(c100409002.spcon)
e3:SetTarget(c100409002.sptg)
e3:SetOperation(c100409002.spop)
c:RegisterEffect(e3)
end
function c100409002.negfilter(c)
return c:IsType(TYPE_MONSTER) and aux.disfilter1(c)
end
function c100409002.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c100409002.negfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100409002.negfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c100409002.negfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c100409002.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 c100409002.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function c100409002.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409002.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(c100409002.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100409002.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,c100409002.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
--ビンゴマシーンGO!GO!
--Bingo Machine GO! GO!
--Script by dest
function c100409003.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,100409003+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100409003.thtg)
e1:SetOperation(c100409003.thop)
c:RegisterEffect(e1)
end
c100409003.card_code_list={89631139,23995346}
function c100409003.thfilter(c)
return (((aux.IsCodeListed(c,89631139) or aux.IsCodeListed(c,23995346)) and not c:IsCode(100409003) and c:IsType(TYPE_SPELL+TYPE_TRAP))
or (c:IsSetCard(0xdd) and c:IsType(TYPE_MONSTER))) and c:IsAbleToHand()
end
function c100409003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409003.thfilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100409003.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100409003.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
--青き眼の激臨
--Rampage with Eyes of Blue
--Script by dest
function c100409004.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(c100409004.cost)
e1:SetTarget(c100409004.target)
e1:SetOperation(c100409004.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(100409004,ACTIVITY_SUMMON,c100409004.counterfilter)
Duel.AddCustomActivityCounter(100409004,ACTIVITY_SPSUMMON,c100409004.counterfilter)
end
c100409004.card_code_list={89631139}
function c100409004.counterfilter(c)
return c:IsCode(89631139)
end
function c100409004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(100409004,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(100409004,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(c100409004.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c100409004.splimit(e,c)
return not c:IsCode(89631139)
end
function c100409004.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409004.rmfilter(c)
return c:IsAbleToRemove() and not c:IsType(TYPE_TOKEN)
end
function c100409004.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100409004.rmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c100409004.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 c100409004.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c100409004.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,c100409004.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
--強靭!無敵!最強!
--The Toughest! The Invincible! The Unbeatable!
--Script by dest
function c100409005.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(c100409005.target)
e1:SetOperation(c100409005.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100409005,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,100409005)
e2:SetCondition(c100409005.setcon)
e2:SetTarget(c100409005.settg)
e2:SetOperation(c100409005.setop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
c100409005.card_code_list={89631139}
function c100409005.filter(c)
return c:IsFaceup() and c:IsSetCard(0xdd)
end
function c100409005.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100409005.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100409005.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c100409005.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100409005.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(c100409005.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(c100409005.descon)
e3:SetOperation(c100409005.desop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
function c100409005.efilter(e,re)
return e:GetHandler()~=re:GetOwner()
end
function c100409005.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc and tc:IsRelateToBattle()
end
function c100409005.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
Duel.Hint(HINT_CARD,0,100409005)
Duel.Destroy(tc,REASON_EFFECT)
end
function c100409005.cfilter(c,tp)
return c:IsCode(89631139) and c:GetSummonPlayer()==tp
end
function c100409005.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100409005.cfilter,1,nil,tp)
end
function c100409005.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 c100409005.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
--サイバー・エタニティ・ドラゴン
--Cyber Eternity Dragon
--Script by dest
function c100409012.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(c100409012.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(100409012,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(c100409012.spcon)
e3:SetTarget(c100409012.sptg)
e3:SetOperation(c100409012.spop)
c:RegisterEffect(e3)
--fusion protection
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100409012,1))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCost(aux.bfgcost)
e4:SetOperation(c100409012.operation)
c:RegisterEffect(e4)
end
c100409012.material_setcode=0x1093
function c100409012.cfilter(c)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_MACHINE)
end
function c100409012.indcon(e)
return Duel.IsExistingMatchingCard(c100409012.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil)
end
function c100409012.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 c100409012.spfilter(c,e,tp)
return c:IsCode(70095154) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100409012.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 c100409012.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(c100409012.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 c100409012.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(c100409012.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 c100409012.efftg(e,c)
return c:IsType(TYPE_FUSION)
end
--サイバー・ファロス
--Cyber Pharos
--Script by dest
function c100409013.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(c100409013.hspcon)
e1:SetOperation(c100409013.hspop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100409013,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c100409013.sptg)
e2:SetOperation(c100409013.spop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100409013,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,100409013)
e3:SetCost(aux.bfgcost)
e3:SetCondition(c100409013.thcon)
e3:SetTarget(c100409013.thtg)
e3:SetOperation(c100409013.thop)
c:RegisterEffect(e3)
end
function c100409013.spfilter(c,tp)
return c:IsRace(RACE_MACHINE)
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c100409013.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.CheckReleaseGroup(tp,c100409013.spfilter,1,nil,tp)
end
function c100409013.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,c100409013.spfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100409013.spfilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c100409013.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 c100409013.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(c100409013.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(c100409013.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 c100409013.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100409013.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c100409013.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(c100409013.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 c100409013.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 c100409013.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100409013.cfilter,1,nil,e,tp)
end
function c100409013.thfilter(c)
return c:IsCode(37630732) and c:IsAbleToHand()
end
function c100409013.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409013.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100409013.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100409013.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
--サイバーロード・フュージョン
--Cyberload Fusion
--Script by dest
function c100409014.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,100409014+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100409014.target)
e1:SetOperation(c100409014.activate)
c:RegisterEffect(e1)
end
function c100409014.filter0(c)
return (c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function c100409014.filter1(c,e)
return (c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c100409014.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 c100409014.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function c100409014.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c100409014.filter0,tp,LOCATION_MZONE+LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(c100409014.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(c100409014.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 c100409014.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(c100409014.filter1,tp,LOCATION_MZONE+LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(c100409014.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(c100409014.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(c100409014.ftarget)
e1:SetLabel(tc:GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c100409014.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
--エターナル・エヴォリューション・バースト
--Eternal Evolution Burst
--Script by dest
function c100409015.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(c100409015.target)
e1:SetOperation(c100409015.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(c100409015.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(c100409015.actcon)
e3:SetValue(c100409015.actlimit)
c:RegisterEffect(e3)
--chain attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100409015,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c100409015.cacon)
e4:SetCost(c100409015.cacost)
e4:SetTarget(c100409015.catg)
e4:SetOperation(c100409015.caop)
c:RegisterEffect(e4)
if not c100409015.global_check then
c100409015.global_check=true
c100409015[0]=0
c100409015[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c100409015.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(c100409015.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c100409015.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffect(100409015)==0 then
c100409015[ep]=c100409015[ep]+1
tc:RegisterFlagEffect(100409015,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c100409015.clear(e,tp,eg,ep,ev,re,r,rp)
c100409015[0]=0
c100409015[1]=0
end
function c100409015.eqlimit(e,c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION)
end
function c100409015.eqfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION)
end
function c100409015.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100409015.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100409015.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100409015.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c100409015.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 c100409015.actcon(e)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()==e:GetHandler():GetControler() and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c100409015.actlimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function c100409015.cacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler():GetEquipTarget() and Duel.GetAttackTarget()~=nil
end
function c100409015.cafilter(c)
return c:IsSetCard(0x1093) and c:IsAbleToRemoveAsCost()
end
function c100409015.cacost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100409015.cafilter,tp,LOCATION_GRAVE,0,1,nil)
and (c100409015[tp]==0 or c:GetEquipTarget():GetFlagEffect(100409015)~=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(c100409015.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,c100409015.cafilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100409015.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c100409015.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 c100409015.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
--サイバネティック・レボリューション
--Cybernetic Revolution
--Script by dest
function c100409016.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,100409016+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100409016.cost)
e1:SetTarget(c100409016.target)
e1:SetOperation(c100409016.activate)
c:RegisterEffect(e1)
end
function c100409016.cfilter(c,tp)
return c:IsCode(70095154) and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c100409016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100409016.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100409016.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100409016.filter(c,e,tp)
return c:IsType(TYPE_FUSION) and aux.IsMaterialListSetCard(c,0x1093) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409016.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409016.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100409016.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,c100409016.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(100409016,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(c100409016.descon)
e2:SetOperation(c100409016.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 c100409016.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(100409016)~=0
end
function c100409016.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
--BF-フルアーマード・ウィング
--Blackwing Full Armored Master
--Script by dest
function c100409023.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(c100409023.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(c100409023.acop)
c:RegisterEffect(e3)
--control
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100409023,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(c100409023.cttg)
e4:SetOperation(c100409023.ctop)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100409023,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(c100409023.descon)
e5:SetTarget(c100409023.destg)
e5:SetOperation(c100409023.desop)
c:RegisterEffect(e5)
end
function c100409023.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c100409023.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 c100409023.ctfilter(c)
return c:GetCounter(0x1002)>0 and c:IsControlerCanBeChanged()
end
function c100409023.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 c100409023.ctfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100409023.ctfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c100409023.ctfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c100409023.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 c100409023.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100409023.desfilter(c)
return c:GetCounter(0x1002)>0
end
function c100409023.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409023.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c100409023.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c100409023.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100409023.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--BF-毒風のシムーン
--Blackwing - Simoom the Poison Winds
--Script by dest
function c100409024.initial_effect(c)
--search and normal summon / gy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100409024,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100409024)
e1:SetCondition(c100409024.sumcon)
e1:SetCost(c100409024.sumcost)
e1:SetTarget(c100409024.sumtg)
e1:SetOperation(c100409024.sumop)
c:RegisterEffect(e1)
end
function c100409024.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c100409024.cfilter(c)
return c:IsSetCard(0x33) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c100409024.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100409024.cfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100409024.cfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100409024.acfilter(c,tp)
return c:IsCode(91351370) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function c100409024.ttcon(e,c,minc)
if c==nil then return true end
return minc==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c100409024.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(c100409024.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(c100409024.ttcon)
c:RegisterEffect(e1)
local res=c:IsSummonable(true,nil) or c:IsAbleToGrave()
e1:Reset()
return res
end
end
function c100409024.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(c100409024.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,c100409024.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(c100409024.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(c100409024.ttcon)
c:RegisterEffect(e2)
if c:IsSummonable(true,nil)
and (not c:IsAbleToGrave() or Duel.SelectYesNo(tp,aux.Stringid(100409024,1))) then
Duel.BreakEffect()
Duel.Summon(tp,c,true,nil)
else
Duel.BreakEffect()
Duel.SendtoGrave(c,REASON_EFFECT)
end
e2:Reset()
end
end
function c100409024.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_DARK) and c:IsLocation(LOCATION_EXTRA)
end
function c100409024.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
--BF-南風のアウステル
--Blackwing - Auster the South Wind
--Script by dest
function c100409025.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(100409025,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(c100409025.sumtg)
e2:SetOperation(c100409025.sumop)
c:RegisterEffect(e2)
--counter
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100409025,1))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c100409025.cttg1)
e3:SetOperation(c100409025.ctop1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(100409025,2))
e4:SetTarget(c100409025.cttg2)
e4:SetOperation(c100409025.ctop2)
c:RegisterEffect(e4)
end
function c100409025.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 c100409025.sumtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c100409025.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100409025.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,c100409025.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100409025.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 c100409025.ctfilter1(c,ct)
return c:IsFaceup() and c:IsCode(9012916) and c:IsCanAddCounter(0x10,ct)
end
function c100409025.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(c100409025.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 c100409025.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,c100409025.ctfilter1,tp,LOCATION_MZONE,0,1,1,nil,ct)
local tc=g:GetFirst()
if tc then
tc:AddCounter(0x10,ct)
end
end
end
function c100409025.ctfilter2(c)
return c:IsFaceup() and c:GetCounter(0x1002)==0 and c:IsCanAddCounter(0x1002,1)
end
function c100409025.cttg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409025.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 c100409025.ctop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100409025.ctfilter2,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
tc:AddCounter(0x1002,1)
tc=g:GetNext()
end
end
--グローウィング・ボウガン
--Glowing Bowgun
--Script by dest
function c100409026.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(c100409026.target)
e1:SetOperation(c100409026.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(c100409026.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(100409026,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,100409026)
e5:SetTarget(c100409026.destg)
e5:SetOperation(c100409026.desop)
c:RegisterEffect(e5)
--tohand
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(100409026,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,100409026+100)
e6:SetCondition(c100409026.retcon)
e6:SetTarget(c100409026.rettg)
e6:SetOperation(c100409026.retop)
c:RegisterEffect(e6)
end
function c100409026.eqlimit(e,c)
return c:IsSetCard(0x33)
end
function c100409026.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x33)
end
function c100409026.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100409026.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100409026.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100409026.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c100409026.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 c100409026.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 c100409026.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 c100409026.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 c100409026.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 c100409026.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
--ブラック・バード・クローズ
--Black Bird Close
--Script by dest
function c100409027.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(c100409027.condition)
e1:SetCost(c100409027.cost)
e1:SetTarget(c100409027.target)
e1:SetOperation(c100409027.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(c100409027.handcon)
c:RegisterEffect(e2)
end
function c100409027.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 c100409027.discfilter(c)
return c:IsFaceup() and c:IsSetCard(0x33) and c:IsAbleToGraveAsCost()
end
function c100409027.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409027.discfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100409027.discfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c100409027.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 c100409027.sfilter(c,e,tp)
return c:IsCode(9012916) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409027.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(c100409027.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if sc and Duel.GetLocationCountFromEx(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(100409027,0)) then
Duel.BreakEffect()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c100409027.cfilter(c)
return c:IsFaceup() and ((c:IsSetCard(0x33) and c:IsType(TYPE_SYNCHRO)) or c:IsCode(9012916))
end
function c100409027.handcon(e)
return Duel.IsExistingMatchingCard(c100409027.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--輝光竜フォトン・ブラスト・ドラゴン
--Starliege Photon Blast Dragon
--Script by nekrozar
function c100409034.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(100409034,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(c100409034.spcon1)
e1:SetTarget(c100409034.sptg1)
e1:SetOperation(c100409034.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(c100409034.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(c100409034.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(100409034,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(c100409034.spcon2)
e4:SetCost(c100409034.spcost2)
e4:SetTarget(c100409034.sptg2)
e4:SetOperation(c100409034.spop2)
c:RegisterEffect(e4)
end
function c100409034.spcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c100409034.spfilter1(c,e,tp)
return c:IsSetCard(0x55) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409034.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100409034.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100409034.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,c100409034.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 c100409034.indcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c100409034.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c100409034.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 c100409034.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 c100409034.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 c100409034.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100409034.spfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100409034.spfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100409034.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
--フォトン・バニッシャー
--Photon Vanisher
--Script by nekrozar
function c100409035.initial_effect(c)
c:SetSPSummonOnce(100409035)
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(c100409035.sprcon)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100409035,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,100409035)
e2:SetTarget(c100409035.thtg)
e2:SetOperation(c100409035.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(c100409035.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(c100409035.effcon)
e4:SetOperation(c100409035.effop)
c:RegisterEffect(e4)
end
function c100409035.sprfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c100409035.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100409035.sprfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100409035.thfilter(c)
return c:IsCode(93717133) and c:IsAbleToHand()
end
function c100409035.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409035.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100409035.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100409035.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 c100409035.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 c100409035.effcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end
function c100409035.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(100409035,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
--フォトン・オービタル
--Photon Orbital
--Script by dest
function c100409036.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100409036,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetTarget(c100409036.eqtg)
e1:SetOperation(c100409036.eqop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100409036,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100409036)
e2:SetCondition(c100409036.thcon)
e2:SetCost(c100409036.thcost)
e2:SetTarget(c100409036.thtg)
e2:SetOperation(c100409036.thop)
c:RegisterEffect(e2)
end
function c100409036.filter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c100409036.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 c100409036.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100409036.filter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100409036.filter,tp,LOCATION_MZONE,0,1,1,c)
end
function c100409036.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(c100409036.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 c100409036.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c100409036.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget()
end
function c100409036.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 c100409036.thfilter(c)
return (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsType(TYPE_MONSTER) and not c:IsCode(100409036) and c:IsAbleToHand()
end
function c100409036.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409036.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100409036.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100409036.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
--フォトン・ハンド
--Photon Hand
--Script by dest
function c100409037.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,100409037+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100409037.condition)
e1:SetCost(c100409037.cost)
e1:SetTarget(c100409037.target)
e1:SetOperation(c100409037.activate)
c:RegisterEffect(e1)
end
function c100409037.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c100409037.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100409037.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100409037.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 c100409037.geffilter(c)
return c:IsFaceup() and c:IsCode(93717133)
end
function c100409037.filter(c,tp)
return (Duel.IsExistingMatchingCard(c100409037.geffilter,tp,LOCATION_ONFIELD,0,1,nil)
or (c:IsFaceup() and c:IsType(TYPE_XYZ))) and c:IsControlerCanBeChanged()
end
function c100409037.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 c100409037.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c100409037.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c100409037.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c100409037.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp)
end
end
--フォトン・チェンジ
--Photon Transformation
--Script by nekrozar
function c100409038.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(c100409038.target)
c:RegisterEffect(e1)
--effect
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100409038,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1,100409038)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetRange(LOCATION_SZONE)
e4:SetCost(c100409038.effcost)
e4:SetTarget(c100409038.efftg)
e4:SetOperation(c100409038.effop)
c:RegisterEffect(e4)
end
function c100409038.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(100409038,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(c100409038.descon)
e1:SetOperation(c100409038.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
c:SetTurnCounter(0)
c:RegisterEffect(e1)
if c100409038.effcost(e,tp,eg,ep,ev,re,r,rp,0)
and c100409038.efftg(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.SelectYesNo(tp,94) then
c100409038.effcost(e,tp,eg,ep,ev,re,r,rp,1)
c100409038.efftg(e,tp,eg,ep,ev,re,r,rp,1)
e:SetOperation(c100409038.effop)
end
end
function c100409038.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100409038.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 c100409038.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(100409038)==0 end
e:GetHandler():RegisterFlagEffect(100409038,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c100409038.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(c100409038.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalCode())
end
function c100409038.spfilter1(c,e,tp,code)
return c:IsSetCard(0x55) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409038.costfilter2(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsAbleToGraveAsCost()
end
function c100409038.thfilter(c)
return c:IsSetCard(0x55) and not c:IsCode(100409038) and c:IsAbleToHand()
end
function c100409038.costfilter3(c,e,tp)
return c:IsFaceup() and c:IsCode(93717133) and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c100409038.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalCode())
end
function c100409038.spfilter2(c,e,tp,code)
return c:IsSetCard(0x55) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c100409038.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c100409038.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c100409038.costfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c100409038.costfilter2,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c100409038.thfilter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
local b3=Duel.IsExistingMatchingCard(c100409038.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(100409038,1),aux.Stringid(100409038,2),aux.Stringid(100409038,3))
elseif b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(100409038,1),aux.Stringid(100409038,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(100409038,1))
else
op=Duel.SelectOption(tp,aux.Stringid(100409038,2))+1
end
e:SetLabel(op)
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100409038.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,c100409038.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,c100409038.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 c100409038.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,c100409038.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,c100409038.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,c100409038.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,c100409038.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
--魔界劇団-メロー・マドンナ
--Abyss Actor - Mellow Madonna
--Script by dest
function c100409045.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100409045,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,100409045)
e1:SetCost(c100409045.thcost)
e1:SetTarget(c100409045.thtg)
e1:SetOperation(c100409045.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(c100409045.val)
c:RegisterEffect(e2)
--spsummon (self)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100409045,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,100409045+100)
e3:SetCondition(c100409045.spcon)
e3:SetTarget(c100409045.sptg)
e3:SetOperation(c100409045.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(100409045,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,100409045+200)
e5:SetCondition(c100409045.spcon2)
e5:SetTarget(c100409045.sptg2)
e5:SetOperation(c100409045.spop2)
c:RegisterEffect(e5)
end
function c100409045.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 c100409045.thfilter(c)
return c:IsSetCard(0x10ec) and not c:IsCode(100409045) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c100409045.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409045.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100409045.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,c100409045.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(c100409045.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100409045.splimit(e,c)
return not (c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM))
end
function c100409045.valfilter(c)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL)
end
function c100409045.val(e,c)
return Duel.GetMatchingGroupCount(c100409045.valfilter,c:GetControler(),LOCATION_GRAVE,0,nil)*100
end
function c100409045.cfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c100409045.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100409045.cfilter,1,nil,tp)
end
function c100409045.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 c100409045.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 c100409045.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 c100409045.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 c100409045.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100409045.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100409045.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,c100409045.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(100409045,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(c100409045.thcon2)
e1:SetOperation(c100409045.thop2)
Duel.RegisterEffect(e1,tp)
end
end
function c100409045.thcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(100409045)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c100409045.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
--魔界劇団-コミック・リリーフ
--Abyss Actor - Comic Relief
--Scripted by ahtelel
function c100409046.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--control
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100409046,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,100409046)
e1:SetTarget(c100409046.cttg)
e1:SetOperation(c100409046.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(100409046,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(c100409046.ctcon)
e4:SetTarget(c100409046.cttg2)
e4:SetOperation(c100409046.ctop2)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100409046,2))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_CONTROL_CHANGED)
e5:SetCountLimit(1)
e5:SetTarget(c100409046.destg)
e5:SetOperation(c100409046.desop)
c:RegisterEffect(e5)
end
function c100409046.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsAbleToChangeControler()
end
function c100409046.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(c100409046.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,c100409046.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 c100409046.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 c100409046.ctcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c100409046.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 c100409046.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 c100409046.desfilter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL) and c:IsSetCard(0x20ec)
end
function c100409046.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 c100409046.desop(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
local g=Duel.GetMatchingGroup(c100409046.desfilter,p,LOCATION_SZONE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(p,aux.Stringid(100409046,3)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DESTROY)
local sg=g:Select(p,1,1,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
--魔界台本「ロマンティック・テラー」
--Abyss Script - Romantic Teller
--Scripted by Eerie Code
function c100409047.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,100409047+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100409047.target)
e1:SetOperation(c100409047.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(c100409047.setcon)
e2:SetTarget(c100409047.settg)
e2:SetOperation(c100409047.setop)
c:RegisterEffect(e2)
end
function c100409047.thfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x10ec) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c100409047.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c100409047.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 c100409047.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409047.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 c100409047.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local hc=Duel.SelectMatchingCard(tp,c100409047.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,c100409047.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 c100409047.filter2(c)
return c:IsSetCard(0x10ec) and c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
function c100409047.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(c100409047.filter2,tp,LOCATION_EXTRA,0,1,nil)
end
function c100409047.setfilter(c)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c100409047.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409047.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c100409047.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100409047.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
--魔界劇場「ファンタスティックシアター」
--Abyss Playhouse – Fantastic Theater
--Scripted by ahtelel
function c100409048.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(100409048,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,100409048)
e2:SetCost(c100409048.thcost)
e2:SetTarget(c100409048.thtg)
e2:SetOperation(c100409048.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(c100409048.chcon1)
e3:SetOperation(c100409048.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,100409148)
e4:SetCondition(c100409048.chcon2)
e4:SetOperation(c100409048.chop2)
c:RegisterEffect(e4)
end
function c100409048.cfilter(c)
return c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and not c:IsPublic()
end
function c100409048.cfilter2(c,tp)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and not c:IsPublic()
and Duel.IsExistingMatchingCard(c100409048.cfilter3,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c100409048.cfilter3(c,code)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and not c:IsCode(code) and c:IsAbleToHand()
end
function c100409048.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409048.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c100409048.cfilter2,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g1=Duel.SelectMatchingCard(tp,c100409048.cfilter,tp,LOCATION_HAND,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,c100409048.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 c100409048.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 c100409048.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100409048.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 c100409048.chcon1(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and re:IsActiveType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(c100409048.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100409048.chop1(e,tp,eg,ep,ev,re,r,rp)
re:GetHandler():RegisterFlagEffect(100409048,RESET_CHAIN,0,1)
end
function c100409048.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100409048.chcon2(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():GetFlagEffect(100409048)>0
and Duel.IsExistingMatchingCard(c100409048.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100409048.chop2(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
return Duel.ChangeChainOperation(ev,c100409048.repop)
end
function c100409048.desfilter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c100409048.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,100409048)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c100409048.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--魔界劇団のカーテンコール
--Abyss Actors Curtain Call
--Scripted by Eerie Code
function c100409049.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,100409049+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100409049.condition)
e1:SetTarget(c100409049.target)
e1:SetOperation(c100409049.activate)
c:RegisterEffect(e1)
--activity check
Duel.AddCustomActivityCounter(100409049,ACTIVITY_CHAIN,c100409049.chainfilter)
end
function c100409049.chainfilter(re,tp,cid)
return not (re:IsActiveType(TYPE_SPELL) and re:GetHandler():IsSetCard(0x20ec))
end
function c100409049.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(100409049,tp,ACTIVITY_CHAIN)>0
end
function c100409049.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c100409049.spfilter(c,e,tp)
return c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409049.ctfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x20ec)
end
function c100409049.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409049.ctfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(c100409049.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 c100409049.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(c100409049.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
local ct=Duel.GetMatchingGroupCount(c100409049.ctfilter,tp,LOCATION_GRAVE,0,nil)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=Duel.SelectMatchingCard(tp,c100409049.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(c100409049.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(100409049,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 c100409049.splimit(e,c)
return not (c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM))
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