Commit c32828a9 authored by nanahira's avatar nanahira

prescripts

parent 0e76aa27
--パーペチュアルキングデーモン
--Perpetual King Archfiend
--Script by nekrozar
function c100223001.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),2,2)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100223001.mtcon)
e1:SetOperation(c100223001.mtop)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223001,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_PAY_LPCOST)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c100223001.tgcon)
e2:SetCost(c100223001.tgcost)
e2:SetTarget(c100223001.tgtg)
e2:SetOperation(c100223001.tgop)
c:RegisterEffect(e2)
--dice
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100223001,1))
e3:SetCategory(CATEGORY_DICE+CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c100223001.dccost)
e3:SetTarget(c100223001.dctg)
e3:SetOperation(c100223001.dcop)
c:RegisterEffect(e3)
end
function c100223001.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100223001.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.CheckLPCost(tp,500) and Duel.SelectYesNo(tp,aux.Stringid(100223001,2)) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
end
end
function c100223001.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c100223001.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(100223001)==0 end
c:RegisterFlagEffect(100223001,RESET_CHAIN,0,1)
end
function c100223001.tgfilter(c,val)
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER) and (c:GetAttack()==val or c:GetDefense()==val) and c:IsAbleToGrave()
end
function c100223001.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100223001.tgfilter,tp,LOCATION_DECK,0,1,nil,ev) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c100223001.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100223001.tgfilter,tp,LOCATION_DECK,0,1,1,nil,ev)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c100223001.dccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(100223101)==0 end
c:RegisterFlagEffect(100223101,RESET_CHAIN,0,1)
end
function c100223001.cfilter(c,e,tp)
return (c:IsRace(RACE_FIEND) or bit.band(c:GetPreviousRaceOnField(),RACE_FIEND)~=0)
and c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
and (c:IsAbleToHand() or c:IsAbleToDeck() or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c100223001.dctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c100223001.cfilter,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c100223001.dcop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.TossDice(tp,1)
local g=eg:Filter(aux.NecroValleyFilter(c100223001.cfilter),nil,e,tp)
if g:GetCount()==0 then return end
local tc=nil
if g:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
tc=g:Select(tp,1,1,nil):GetFirst()
else
tc=g:GetFirst()
end
if d==1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
elseif d==6 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
--剣闘獣ドラガシス
--Gladiator Beast Dragacius
--Scripted by Eerie Code
function c100223006.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x19),2,2)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c100223006.indtg)
e1:SetValue(1)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(c100223006.aclimit)
e2:SetCondition(c100223006.actcon)
c:RegisterEffect(e2)
--special summon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(100223006,0))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_PHASE+PHASE_BATTLE)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1,100223006)
e6:SetCondition(c100223006.spcon)
e6:SetCost(c100223006.spcost)
e6:SetTarget(c100223006.sptg)
e6:SetOperation(c100223006.spop)
c:RegisterEffect(e6)
end
function c100223006.indtg(e,c)
return c:IsSetCard(0x19) and Duel.GetAttacker()==c
end
function c100223006.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function c100223006.actcon(e)
local tc=Duel.GetAttacker()
local tp=e:GetHandlerPlayer()
return tc and tc:IsControler(tp) and tc:IsSetCard(0x19)
end
function c100223006.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0
end
function c100223006.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToExtraAsCost() end
Duel.SendtoDeck(c,nil,0,REASON_COST)
end
function c100223006.spfilter(c,e,tp)
return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,125,tp,false,false)
end
function c100223006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
local g=Duel.GetMatchingGroup(c100223006.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return ft>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:GetClassCount(Card.GetCode)>=2
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c100223006.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c100223006.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>=2 and g:GetClassCount(Card.GetCode)>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=g:Select(tp,1,1,nil)
local tc1=sg1:GetFirst()
g:Remove(Card.IsCode,nil,tc1:GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g:Select(tp,1,1,nil)
local tc2=sg2:GetFirst()
sg1:Merge(sg2)
local tc=sg1:GetFirst()
Duel.SpecialSummonStep(tc,125,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
tc=sg1:GetNext()
Duel.SpecialSummonStep(tc,125,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
Duel.SpecialSummonComplete()
end
end
--ライトロード・ドミニオン キュリオス
--Kyrios, Dominion of the Lightsworn
--Scripted by Eerie Code
function c100223011.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,3,3,c100223011.lcheck)
c:EnableReviveLimit()
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223011,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100223011)
e1:SetCondition(c100223011.tgcon)
e1:SetTarget(c100223011.tgtg)
e1:SetOperation(c100223011.tgop)
c:RegisterEffect(e1)
--discard deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223011,2))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCategory(CATEGORY_DECKDES)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,100223011+100)
e2:SetCondition(c100223011.ddcon)
e2:SetTarget(c100223011.ddtg)
e2:SetOperation(c100223011.ddop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100223011,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(c100223011.thcon)
e3:SetTarget(c100223011.thtg)
e3:SetOperation(c100223011.thop)
c:RegisterEffect(e3)
end
function c100223011.lcheck(g)
return g:GetClassCount(Card.GetAttribute)==1 and g:GetClassCount(Card.GetRace)==g:GetCount()
end
function c100223011.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223011.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c100223011.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c100223011.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp
end
function c100223011.ddcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and eg:IsExists(c100223011.cfilter,1,nil,tp)
end
function c100223011.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function c100223011.ddop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end
function c100223011.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp))
and c:IsPreviousPosition(POS_FACEUP)
end
function c100223011.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100223011.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--ジェムナイト・ファントムルーツ
--Gem-Knight Phantom Roots
--Script by nekrozar
function c100223016.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x47),2,2)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223016,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100223016)
e1:SetCondition(c100223016.thcon)
e1:SetTarget(c100223016.thtg)
e1:SetOperation(c100223016.thop)
c:RegisterEffect(e1)
--fusion summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223016,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100223116)
e2:SetCost(c100223016.spcost)
e2:SetTarget(c100223016.sptg)
e2:SetOperation(c100223016.spop)
c:RegisterEffect(e2)
end
function c100223016.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223016.thfilter(c)
return c:IsSetCard(0x1047) and c:IsAbleToHand()
end
function c100223016.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100223016.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100223016.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100223016.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 c100223016.spcost(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 c100223016.filter0(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c100223016.filter1(c,e)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
end
function c100223016.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x1047) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100223016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c100223016.filter0,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(c100223016.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c100223016.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100223016.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local chkf=tp
local mg1=Duel.GetMatchingGroup(c100223016.filter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(c100223016.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c100223016.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoDeck(mat1,nil,2,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc:CompleteProcedure()
end
end
--甲虫装機 ピコファレーナ
--Inzektor Picofarena
--Scripted by Eerie Code
function c100223026.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_INSECT),2,2)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223026,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100223026)
e1:SetCondition(c100223026.eqcon)
e1:SetCost(c100223026.eqcost)
e1:SetTarget(c100223026.eqtg)
e1:SetOperation(c100223026.eqop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223026,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100223126)
e2:SetTarget(c100223026.drtg)
e2:SetOperation(c100223026.drop)
c:RegisterEffect(e2)
end
function c100223026.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223026.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100223026.filter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function c100223026.eqfilter(c,tp)
return c:IsRace(RACE_INSECT) and c:CheckUniqueOnField(tp) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c100223026.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c100223026.filter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c100223026.filter,tp,LOCATION_MZONE,0,1,c)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100223026.eqfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100223026.filter,tp,LOCATION_MZONE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function c100223026.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=Duel.SelectMatchingCard(tp,c100223026.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if ec then
Duel.Equip(tp,tc,ec,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c100223026.eqlimit2)
e1:SetLabelObject(ec)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e3)
end
end
function c100223026.eqlimit2(e,c)
return c==e:GetLabelObject()
end
function c100223026.tdfilter(c)
return c:IsRace(RACE_INSECT) and c:IsAbleToDeck()
end
function c100223026.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100223026.tdfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c100223026.tdfilter,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100223026.tdfilter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100223026.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()<=0 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--天球の聖刻印
--Hieratic Seal of the Celestial Spheres
--Scripted by Eerie Code
function c100223031.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),2,2)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223031,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100223031.thcon)
e1:SetCost(c100223031.thcost)
e1:SetTarget(c100223031.thtg)
e1:SetOperation(c100223031.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223031,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100223031)
e2:SetTarget(c100223031.sptg)
e2:SetOperation(c100223031.spop)
c:RegisterEffect(e2)
end
function c100223031.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSequence()>4 and Duel.GetTurnPlayer()~=tp
end
function c100223031.thcfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReleasable()
and Duel.IsExistingMatchingCard(c100223031.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c100223031.thfilter(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c100223031.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100223031.thcfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c100223031.thcfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100223031.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_ONFIELD)
end
function c100223031.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c100223031.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c100223031.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100223031.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100223031.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c100223031.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,c100223031.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
--魔導原典 クロウリー
--Crowley the Origin of Prophecy
--Scripted by Eerie Code
function c100223036.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),2,2)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223036,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100223036)
e1:SetCondition(c100223036.thcon)
e1:SetTarget(c100223036.thtg)
e1:SetOperation(c100223036.thop)
c:RegisterEffect(e1)
--decrease tribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223036,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetCountLimit(1)
e2:SetCondition(c100223036.ntcon)
e2:SetTarget(c100223036.nttg)
c:RegisterEffect(e2)
end
function c100223036.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223036.thfilter(c)
return c:IsSetCard(0x106e) and c:IsAbleToHand()
end
function c100223036.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local dg=Duel.GetMatchingGroup(c100223036.thfilter,tp,LOCATION_DECK,0,nil)
return dg:GetClassCount(Card.GetCode)>=3
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100223036.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100223036.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg2=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg2:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg3=g:Select(tp,1,1,nil)
sg1:Merge(sg2)
sg1:Merge(sg3)
Duel.ConfirmCards(1-tp,sg1)
local cg=sg:RandomSelect(1-tp,1)
local tc=cg:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ShuffleDeck(tp)
end
end
function c100223036.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c100223036.nttg(e,c)
return c:IsLevelAbove(5) and c:IsRace(RACE_SPELLCASTER)
end
--水精鱗-サラキアビス
--Mermail Abyssaraki
--Script by nekrozar
function c100223046.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_AQUA+RACE_FISH+RACE_SEASERPENT),2,2)
c:EnableReviveLimit()
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c100223046.indtg)
e1:SetValue(500)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100223046,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100223046)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCondition(c100223046.thcon)
e3:SetCost(c100223046.thcost)
e3:SetTarget(c100223046.thtg)
e3:SetOperation(c100223046.thop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100223046,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,100223146)
e4:SetCondition(c100223046.spcon)
e4:SetCost(c100223046.spcost)
e4:SetTarget(c100223046.sptg)
e4:SetOperation(c100223046.spop)
c:RegisterEffect(e4)
end
function c100223046.indtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c100223046.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c100223046.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100223046.thfilter(c)
return c:IsSetCard(0x74) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100223046.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100223046.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100223046.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100223046.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 c100223046.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp
and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)))
end
function c100223046.spcfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
end
function c100223046.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100223046.spcfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100223046.spcfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c100223046.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100223046.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100223046.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100223046.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100223046.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100223046.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--シャドール・ネフィリム
--Shaddoll Construct
--Scripted by Eerie Code
function c100223056.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_FLIP),2,2)
--fusion summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223056,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100223056)
e1:SetTarget(c100223056.sptg)
e1:SetOperation(c100223056.spop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223056,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100223056+100)
e2:SetTarget(c100223056.sptg2)
e2:SetOperation(c100223056.spop2)
c:RegisterEffect(e2)
end
function c100223056.spfilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c100223056.spfilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x9d) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100223056.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(c100223056.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(c100223056.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 c100223056.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100223056.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c100223056.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(c100223056.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 c100223056.cfilter(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsSetCard(0x9d) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c100223056.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c100223056.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100223056.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,c100223056.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,tp)
local tc=tg:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE)
and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--クリフォート・ゲニウス
--Qliphort Genius
--Scripted by Eerie Code
function c100223061.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),2,2)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetCondition(c100223061.immcon)
e1:SetValue(c100223061.efilter)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223061,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c100223061.distg)
e2:SetOperation(c100223061.disop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100223061,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100223061.thcon)
e3:SetTarget(c100223061.thtg)
e3:SetOperation(c100223061.thop)
c:RegisterEffect(e3)
end
function c100223061.immcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223061.efilter(e,te)
if te:IsActiveType(TYPE_SPELL+TYPE_TRAP) then return true
else return te:IsActiveType(TYPE_LINK) and te:IsActivated() and te:GetOwner()~=e:GetOwner() end
end
function c100223061.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,1,nil)
end
function c100223061.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=2 then return end
for tc in aux.Next(g) do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
function c100223061.thcfilter(c,lg)
return lg:IsContains(c)
end
function c100223061.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lg=c:GetLinkedGroup()
return not eg:IsContains(c) and eg:FilterCount(c100223061.thcfilter,nil,lg)==2
end
function c100223061.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsLevelAbove(5) and c:IsAbleToHand()
end
function c100223061.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100223061.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100223061.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100223061.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
--アロマセラフィ-ジャスミン
--Aromaseraphy Jasmine
--Scripted by Eerie Code
function c100223076.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_PLANT),2,2)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetCondition(c100223076.indcon)
e1:SetTarget(c100223076.indtg)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223076,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100223076)
e2:SetCost(c100223076.spcost)
e2:SetTarget(c100223076.sptg)
e2:SetOperation(c100223076.spop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100223076,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_RECOVER)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c100223076.thcon)
e3:SetTarget(c100223076.thtg)
e3:SetOperation(c100223076.thop)
c:RegisterEffect(e3)
end
function c100223076.indcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetLP(tp)>Duel.GetLP(1-tp)
end
function c100223076.indtg(e,c)
return e:GetHandler()==c or (c:IsRace(RACE_PLANT) and e:GetHandler():GetLinkedGroup():IsContains(c))
end
function c100223076.cfilter(c,g)
return g:IsContains(c)
end
function c100223076.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.CheckReleaseGroup(tp,c100223076.cfilter,1,nil,lg) end
local g=Duel.SelectReleaseGroup(tp,c100223076.cfilter,1,1,nil,lg)
Duel.Release(g,REASON_COST)
end
function c100223076.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100223076.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c100223076.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100223076.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,c100223076.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c100223076.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c100223076.thfilter(c)
return c:IsRace(RACE_PLANT) and c:IsAbleToHand()
end
function c100223076.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 c100223076.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100223076.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
--彼岸の黒天使 ケルビーニ
--Cherubini, Black Angel of the Burning Abyss
--Scripted by Eerie Code
function c100223081.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLevel,3),2,2)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c100223081.indtg)
e1:SetValue(1)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetTarget(c100223081.desreptg)
c:RegisterEffect(e2)
--boost
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100223081,0))
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetLabel(0)
e3:SetCountLimit(1,100223081)
e3:SetCost(c100223081.atkcost)
e3:SetTarget(c100223081.atktg)
e3:SetOperation(c100223081.atkop)
c:RegisterEffect(e3)
end
function c100223081.indtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c100223081.repfilter(c)
return not c:IsStatus(STATUS_DESTROY_CONFIRMED)
end
function c100223081.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE) and (c:IsReason(REASON_BATTLE) or rp~=tp)
and Duel.IsExistingMatchingCard(c100223081.repfilter,tp,LOCATION_ONFIELD,0,1,c) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100223081.repfilter,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
function c100223081.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c100223081.cfilter(c)
return c:IsLevel(3) and (c:GetBaseAttack()>0 or c:GetBaseDefense()>0) and c:IsAbleToGraveAsCost()
end
function c100223081.filter(c)
return c:IsFaceup() and c:IsSetCard(0xb1)
end
function c100223081.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100223081.filter(chkc) end
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c100223081.cfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingTarget(c100223081.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100223081.cfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabelObject(g:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100223081.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c100223081.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local sc=e:GetLabelObject()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and sc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(sc:GetAttack())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(sc:GetDefense())
tc:RegisterEffect(e2)
end
end
--ヘビーメタルフォーゼ・エレクトラム
--Heavymetalfoes Electrum
--Scripted by Eerie Code
function c100223086.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_PENDULUM),2,2)
--to extra
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223086,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c100223086.tecon)
e1:SetTarget(c100223086.tetg)
e1:SetOperation(c100223086.teop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223086,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c100223086.destg)
e2:SetOperation(c100223086.desop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100223086,2))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100223086)
e3:SetCondition(c100223086.drcon)
e3:SetTarget(c100223086.drtg)
e3:SetOperation(c100223086.drop)
c:RegisterEffect(e3)
end
function c100223086.tecon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223086.tefilter(c)
return c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function c100223086.tetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100223086.tefilter,tp,LOCATION_DECK,0,1,nil) end
end
function c100223086.teop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100223086,3))
local g=Duel.SelectMatchingCard(tp,c100223086.tefilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoExtraP(g,tp,REASON_EFFECT)
end
end
function c100223086.thfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c100223086.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,c)
and Duel.IsExistingMatchingCard(c100223086.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function c100223086.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100223086.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c100223086.drcfilter(c,tp)
return c:IsPreviousLocation(LOCATION_PZONE) and c:GetPreviousControler()==tp
end
function c100223086.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100223086.drcfilter,1,nil,tp)
end
function c100223086.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100223086.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
--水晶機巧-ハリファイバー
--Crystron Halifiber
--Scripted by Eerie Code
function c100223091.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c100223091.lcheck)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223091,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:SetCountLimit(1,100223091)
e1:SetCondition(c100223091.hspcon)
e1:SetTarget(c100223091.hsptg)
e1:SetOperation(c100223091.hspop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223091,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_MAIN_END+TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100223091+100)
e2:SetCondition(c100223091.spcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100223091.sptg)
e2:SetOperation(c100223091.spop)
c:RegisterEffect(e2)
end
function c100223091.lcheck(g,lc)
return g:IsExists(Card.IsType,1,nil,TYPE_TUNER)
end
function c100223091.hspcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223091.hspfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsLevelBelow(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100223091.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100223091.hspfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c100223091.hspop(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,c100223091.hspfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
function c100223091.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
end
function c100223091.spfilter(c,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c100223091.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c100223091.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100223091.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCountFromEx(tp)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c100223091.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
......@@ -50,7 +50,7 @@ function c100224002.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c100224002.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsSSetable() then
if tc and tc:IsRelateToEffect(e) and tc:IsSSetable() then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
end
......
......@@ -20,10 +20,11 @@ function c101004056.spfilter(c,e,tp)
end
function c101004056.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101004056.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c101004056.desfilter,tp,LOCATION_ONFIELD,0,1,c,tp)
and Duel.IsExistingTarget(c101004056.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c101004056.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
local g1=Duel.SelectTarget(tp,c101004056.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c101004056.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0)
......
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