Commit ba6992a5 authored by mercury233's avatar mercury233

new cards FLOD

parent c8f586d9
--無限泡影
function c10045474.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetTarget(c10045474.target)
e1:SetOperation(c10045474.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(c10045474.handcon)
c:RegisterEffect(e2)
end
function c10045474.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 aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_MZONE,1,1,nil)
end
function c10045474.activate(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: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: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
if not c:IsStatus(STATUS_ACT_FROM_HAND) and c:IsLocation(LOCATION_SZONE) then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e4:SetTarget(c10045474.distg)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetLabel(c:GetSequence())
Duel.RegisterEffect(e4,tp)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetOperation(c10045474.disop)
e5:SetReset(RESET_PHASE+PHASE_END)
e5:SetLabel(c:GetSequence())
Duel.RegisterEffect(e5,tp)
end
end
end
function c10045474.distg(e,c)
local seq=e:GetLabel()
local p=c:GetControler()
local tp=e:GetHandlerPlayer()
return c:IsType(TYPE_SPELL+TYPE_TRAP)
and ((p==tp and c:GetSequence()==seq) or (p==1-tp and c:GetSequence()==4-seq))
end
function c10045474.disop(e,tp,eg,ep,ev,re,r,rp)
local tseq=e:GetLabel()
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local p=re:GetHandlerPlayer()
local tp=e:GetHandlerPlayer()
if bit.band(loc,LOCATION_SZONE)~=0 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and ((p==tp and seq==tseq) or (p==1-tp and seq==4-tseq)) then
Duel.NegateEffect(ev)
end
end
function c10045474.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
end
--夢幻崩界イヴリース
function c10158145.initial_effect(c)
--spsummon link
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10158145,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c10158145.sptg)
e1:SetOperation(c10158145.spop)
c:RegisterEffect(e1)
--splimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(c10158145.splimit)
c:RegisterEffect(e2)
--spsummon opp
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10158145,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,10158145)
e3:SetCondition(c10158145.condition)
e3:SetTarget(c10158145.target)
e3:SetOperation(c10158145.operation)
c:RegisterEffect(e3)
end
function c10158145.get_zone(c,seq)
local zone=0
if seq<4 and c:IsLinkMarker(LINK_MARKER_LEFT) then zone=bit.bor(zone,math.pow(2,seq+1)) end
if seq>0 and seq<5 and c:IsLinkMarker(LINK_MARKER_RIGHT) then zone=bit.bor(zone,math.pow(2,seq-1)) end
return zone
end
function c10158145.spfilter(c,e,tp,seq)
local zone=c10158145.get_zone(c,seq)
return zone~=0 and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c10158145.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local seq=e:GetHandler():GetSequence()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c10158145.spfilter(chkc,e,tp,seq) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c10158145.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,seq) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c10158145.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,seq)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c10158145.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsControler(tp) and tc:IsRelateToEffect(e) then
local zone=c10158145.get_zone(tc,c:GetSequence())
if zone~=0 and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP,zone) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
end
function c10158145.splimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsType(TYPE_LINK)
end
function c10158145.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():GetPreviousControler()==tp
end
function c10158145.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c10158145.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
end
--やぶ蛇
function c10813327.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10813327,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c10813327.spcon)
e1:SetTarget(c10813327.sptg)
e1:SetOperation(c10813327.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
end
function c10813327.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp~=tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c10813327.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10813327.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
return loc~=0 and Duel.IsExistingMatchingCard(c10813327.spfilter,tp,loc,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c10813327.spop(e,tp,eg,ep,ev,re,r,rp)
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c10813327.spfilter,tp,loc,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ヤジロベーダー
function c10852583.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c10852583.descon)
e1:SetOperation(c10852583.desop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--move
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10852583,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c10852583.seqcon)
e3:SetOperation(c10852583.seqop)
c:RegisterEffect(e3)
--move
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(10852583,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c10852583.mvcon)
e4:SetTarget(c10852583.mvtg)
e4:SetOperation(c10852583.mvop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function c10852583.descon(e)
return e:GetHandler():GetSequence()~=2
end
function c10852583.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c10852583.seqcon(e,tp,eg,ep,ev,re,r,rp)
local seq=e:GetHandler():GetSequence()
if seq>4 then return false end
return (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))
end
function c10852583.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end
local seq=c:GetSequence()
if seq>4 then return end
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then
local flag=0
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end
flag=bit.bxor(flag,0xff)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(c,nseq)
end
end
function c10852583.mvcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:GetFirst():IsControler(1-tp)
end
function c10852583.mvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=eg:GetFirst()
tc:CreateEffectRelation(e)
end
function c10852583.desfilter(c,g)
return g:IsContains(c)
end
function c10852583.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp)
or not tc:IsRelateToEffect(e) or tc:IsControler(tp) then return end
local seq1=c:GetSequence()
local seq2=tc:GetSequence()
if seq1>4 then return end
if seq2==5 then seq2=1 end
if seq2==6 then seq2=3 end
seq2=4-seq2
if (seq1>seq2 and Duel.CheckLocation(tp,LOCATION_MZONE,seq1-1))
or (seq1<seq2 and Duel.CheckLocation(tp,LOCATION_MZONE,seq1+1)) then
local nseq=0
if seq1>seq2 and Duel.CheckLocation(tp,LOCATION_MZONE,seq1-1) then nseq=seq1-1
else nseq=seq1+1 end
Duel.MoveSequence(c,nseq)
local cg=c:GetColumnGroup()
local g=Duel.GetMatchingGroup(c10852583.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.Destroy(g,REASON_EFFECT)
end
end
end
--霊神統一
function c11167052.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)
c:RegisterEffect(e1)
--indes/untarget
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c11167052.intg)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(1)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(11167052,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetRange(LOCATION_SZONE)
e4:SetCost(c11167052.spcost)
e4:SetTarget(c11167052.sptg)
e4:SetOperation(c11167052.spop)
c:RegisterEffect(e4)
--discard & salvage
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(11167052,1))
e5:SetCategory(CATEGORY_HANDES+CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetRange(LOCATION_SZONE)
e5:SetCost(c11167052.thcost)
e5:SetTarget(c11167052.thtg)
e5:SetOperation(c11167052.thop)
c:RegisterEffect(e5)
end
function c11167052.intg(e,c)
return c:IsFaceup() and c:IsCode(61557074)
end
function c11167052.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c11167052.filter1(c,e,tp)
return Duel.IsExistingMatchingCard(c11167052.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalAttribute())
and Duel.GetMZoneCount(tp,c)>0
end
function c11167052.filter2(c,e,tp,att)
return c:IsSetCard(0x400d) and c:GetOriginalAttribute()~=att and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11167052.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c11167052.filter1,1,nil,e,tp)
end
local rg=Duel.SelectReleaseGroup(tp,c11167052.filter1,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetOriginalAttribute())
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c11167052.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local att=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11167052.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,att)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c11167052.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 c11167052.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x113) and c:IsAbleToHand()
end
function c11167052.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local ct=hg:GetCount()
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(c11167052.thfilter,tp,LOCATION_GRAVE,0,ct,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,hg,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,ct,tp,LOCATION_GRAVE)
end
function c11167052.thop(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local ct=Duel.SendtoGrave(hg,REASON_EFFECT+REASON_DISCARD)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c11167052.thfilter),tp,LOCATION_GRAVE,0,ct,ct,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
--ティンダングル・トリニティ
function c11375683.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11375683,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c11375683.sptg)
e1:SetOperation(c11375683.spop)
c:RegisterEffect(e1)
--flip
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FLIP)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c11375683.flipop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x10b))
e3:SetCondition(c11375683.indcon)
e3:SetValue(1)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(11375683,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_BE_MATERIAL)
e4:SetCountLimit(1,11375683)
e4:SetCondition(c11375683.thcon)
e4:SetTarget(c11375683.thtg)
e4:SetOperation(c11375683.thop)
c:RegisterEffect(e4)
end
function c11375683.spfilter(c,e,tp)
return c:IsCode(94365540) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11375683.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11375683.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c11375683.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstMatchingCard(c11375683.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c11375683.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(11375683,RESET_EVENT+0x1fe0000,0,1)
end
function c11375683.indcon(e)
return e:GetHandler():GetFlagEffect(11375683)~=0
end
function c11375683.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0x10b)
end
function c11375683.thfilter(c,tp)
return c:IsCode(59490397) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c11375683.tgfilter,tp,LOCATION_DECK,0,1,c)
end
function c11375683.tgfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function c11375683.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11375683.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c11375683.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=Duel.SelectMatchingCard(tp,c11375683.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if hg:GetCount()>0 and Duel.SendtoHand(hg,tp,REASON_EFFECT)>0
and hg:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,hg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c11375683.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
--剛鬼ハッグベア
function c12097275.initial_effect(c)
--atk down
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetDescription(aux.Stringid(12097275,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,12097275)
e1:SetTarget(c12097275.atktg)
e1:SetOperation(c12097275.atkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c12097275.atkcon)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12097275,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,12097276)
e3:SetCondition(c12097275.thcon)
e3:SetTarget(c12097275.thtg)
e3:SetOperation(c12097275.thop)
c:RegisterEffect(e3)
end
function c12097275.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.nzatk(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.nzatk,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil)
end
function c12097275.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(math.ceil(tc:GetBaseAttack()/2))
tc:RegisterEffect(e1)
end
end
function c12097275.atkcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0xfc)
end
function c12097275.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c12097275.thfilter(c)
return c:IsSetCard(0xfc) and not c:IsCode(12097275) and c:IsAbleToHand()
end
function c12097275.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12097275.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c12097275.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c12097275.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 c12989604.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,12989604+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c12989604.target)
e1:SetOperation(c12989604.activate)
c:RegisterEffect(e1)
end
function c12989604.filter(c)
return c:IsSpecialSummonable(SUMMON_TYPE_LINK)
end
function c12989604.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12989604.filter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c12989604.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c12989604.filter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_LINK)
end
end
--発条補修ゼンマイコン
function c1735088.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x58),2,2)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1735088,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,1735088)
e1:SetCondition(c1735088.thcon)
e1:SetTarget(c1735088.thtg)
e1:SetOperation(c1735088.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1735088,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,1735089)
e2:SetCost(c1735088.spcost)
e2:SetTarget(c1735088.sptg)
e2:SetOperation(c1735088.spop)
c:RegisterEffect(e2)
--material
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(1735088,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c1735088.matcon)
e3:SetTarget(c1735088.mattg)
e3:SetOperation(c1735088.matop)
c:RegisterEffect(e3)
end
function c1735088.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c1735088.thfilter(c)
return c:IsSetCard(0x58) and c:IsAbleToHand()
end
function c1735088.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1735088.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c1735088.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c1735088.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 c1735088.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c1735088.cfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x58) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c1735088.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
function c1735088.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1735088.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c1735088.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c1735088.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c1735088.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c1735088.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c1735088.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c1735088.matfilter(c)
return c:IsFaceup() and c:IsSetCard(0x58) and c:IsType(TYPE_XYZ)
end
function c1735088.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c1735088.matfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1735088.matfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c1735088.matfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c1735088.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
--エレメントセイバー・ラパウィラ
function c18214905.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18214905,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c18214905.negcon)
e1:SetCost(c18214905.negcost)
e1:SetTarget(c18214905.negtg)
e1:SetOperation(c18214905.negop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(18214905,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c18214905.atttg)
e2:SetOperation(c18214905.attop)
c:RegisterEffect(e2)
end
function c18214905.negcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c18214905.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c18214905.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c18214905.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c18214905.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c18214905.negtg(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 c18214905.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c18214905.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c18214905.attop(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_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--エレメントセイバー・マカニ
function c19036557.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19036557,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c19036557.thcost)
e1:SetTarget(c19036557.thtg)
e1:SetOperation(c19036557.thop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(19036557,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c19036557.atttg)
e2:SetOperation(c19036557.attop)
c:RegisterEffect(e2)
end
function c19036557.costfilter(c,tp)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c19036557.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c19036557.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c19036557.costfilter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c19036557.costfilter,tp,loc,0,1,1,nil,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c19036557.thfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsCode(19036557) and (c:IsSetCard(0x400d) or c:IsSetCard(0x113)) and c:IsAbleToHand()
end
function c19036557.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19036557.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c19036557.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c19036557.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 c19036557.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c19036557.attop(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_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--急き兎馬
--not fully implemented
function c19636995.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+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,0)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,19636995)
e1:SetCondition(c19636995.hspcon)
e1:SetValue(c19636995.hspval)
c:RegisterEffect(e1)
--self destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(19636995,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_CUSTOM+19636995)
e2:SetTarget(c19636995.destg)
e2:SetOperation(c19636995.desop)
c:RegisterEffect(e2)
--custom EVENT_PLACED
local e2a=Effect.CreateEffect(c)
e2a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2a:SetRange(LOCATION_MZONE)
e2a:SetCode(EVENT_ADJUST)
e2a:SetOperation(c19636995.plchk)
c:RegisterEffect(e2a)
--direct attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19636995,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c19636995.datop)
c:RegisterEffect(e3)
end
function c19636995.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=0x1f
local lg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
for tc in aux.Next(lg) do
zone=bit.band(zone,bit.bnot(tc:GetColumnZone(LOCATION_MZONE,0,0,tp)))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c19636995.hspval(e,c)
local tp=c:GetControler()
local zone=0x1f
local lg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
for tc in aux.Next(lg) do
zone=bit.band(zone,bit.bnot(tc:GetColumnZone(LOCATION_MZONE,0,0,tp)))
end
return 0,zone
end
function c19636995.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c19636995.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function c19636995.plfilter(c)
return not c:IsStatus(STATUS_SUMMONING) and not c:IsStatus(STATUS_SUMMON_DISABLED)
end
function c19636995.gfilter(c,g)
return not g:IsContains(c)
end
function c19636995.plchk(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cg=c:GetColumnGroup():Filter(c19636995.plfilter,nil)
if c:GetFlagEffect(19636996)==0 or c:GetFlagEffectLabel(19636996)~=c:GetSequence() then
c:ResetFlagEffect(19636996)
c:RegisterFlagEffect(19636996,RESET_EVENT+0x1fd0000,0,1,c:GetSequence())
cg:KeepAlive()
e:SetLabelObject(cg)
elseif cg:IsExists(c19636995.gfilter,1,nil,e:GetLabelObject()) then
cg:KeepAlive()
e:SetLabelObject(cg)
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+19636995,e,0,0,0,0)
end
end
function c19636995.datop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(math.ceil(c:GetBaseAttack()/2))
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
--トリックスター・マンドレイク
function c22219822.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22219822,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,22219822)
e1:SetCondition(c22219822.spcon)
e1:SetTarget(c22219822.sptg)
e1:SetOperation(c22219822.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22219822,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,22219823)
e2:SetCondition(c22219822.descon)
e2:SetTarget(c22219822.destg)
e2:SetOperation(c22219822.desop)
c:RegisterEffect(e2)
end
function c22219822.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c22219822.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,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c22219822.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_DEFENSE)~=0 then
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+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
function c22219822.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xfb)
end
function c22219822.lkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c22219822.desfilter(c,g)
return g:IsContains(c)
end
function c22219822.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Group.CreateGroup()
local lg=Duel.GetMatchingGroup(c22219822.lkfilter,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(lg) do
tg:Merge(tc:GetLinkedGroup())
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22219822.desfilter(chkc,tg) end
if chk==0 then return Duel.IsExistingTarget(c22219822.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c22219822.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c22219822.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--レッド・リブート
function c23002292.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c23002292.condition)
e1:SetCost(c23002292.cost)
e1:SetTarget(c23002292.target)
e1:SetOperation(c23002292.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2)
end
function c23002292.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and re:IsActiveType(TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c23002292.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
end
function c23002292.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable(true)
end
function c23002292.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)
end
function c23002292.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) then
rc:CancelToGrave()
Duel.ChangePosition(rc,POS_FACEDOWN)
Duel.RaiseEvent(rc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
local g=Duel.GetMatchingGroup(c23002292.setfilter,tp,0,LOCATION_DECK,nil)
if g:GetCount()>0 and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(23002292,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(1-tp,1,1,nil)
Duel.SSet(1-tp,sg:GetFirst())
Duel.ConfirmCards(tp,sg)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(0,LOCATION_SZONE+LOCATION_HAND)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_TRAP))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--リンク・ストリーマー
function c23331400.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,23331400)
e1:SetCondition(c23331400.tkcon)
e1:SetTarget(c23331400.tktg)
e1:SetOperation(c23331400.tkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c23331400.cfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsControler(tp)
end
function c23331400.tkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23331400.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c23331400.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,23331401,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c23331400.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,23331401,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) then
local token=Duel.CreateToken(tp,23331401)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
--墓穴の指名者
function c24224830.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c24224830.target)
e1:SetOperation(c24224830.activate)
c:RegisterEffect(e1)
end
function c24224830.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c24224830.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and c24224830.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c24224830.filter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c24224830.filter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c24224830.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c24224830.distg)
e1:SetLabel(tc:GetOriginalCode())
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(c24224830.discon)
e2:SetOperation(c24224830.disop)
e2:SetLabel(tc:GetOriginalCode())
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
end
function c24224830.distg(e,c)
local code=e:GetLabel()
local code1,code2=c:GetOriginalCodeRule()
return code1==code or code2==code
end
function c24224830.discon(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabel()
local code1,code2=re:GetHandler():GetOriginalCodeRule()
return re:IsActiveType(TYPE_MONSTER) and (code1==code or code2==code)
end
function c24224830.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--雪花の光
function c24940422.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24940422,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,24940422)
e1:SetCondition(c24940422.condition)
e1:SetTarget(c24940422.target)
e1:SetOperation(c24940422.activate)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(24940422,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,24940423)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c24940422.tdtg)
e2:SetOperation(c24940422.tdop)
c:RegisterEffect(e2)
end
function c24940422.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_SPELL+TYPE_TRAP)
end
function c24940422.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c24940422.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c24940422.aclimit)
Duel.RegisterEffect(e1,tp)
end
function c24940422.aclimit(e,re,tp)
return not re:GetHandler():IsCode(24940422) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:GetHandler():IsImmuneToEffect(e)
end
function c24940422.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c24940422.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(c24940422.tdfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c24940422.tdop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(c24940422.tdfilter,p,LOCATION_HAND,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,1,1,nil)
Duel.ConfirmCards(1-p,sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(p)
Duel.BreakEffect()
Duel.Draw(p,1,REASON_EFFECT)
end
end
--星遺物へ誘う悪夢
function c25163979.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--avoid battle damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c25163979.efilter)
e2:SetValue(1)
c:RegisterEffect(e2)
--move
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(25163979,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetTarget(c25163979.mvtg)
e3:SetOperation(c25163979.mvop)
c:RegisterEffect(e3)
end
function c25163979.efilter(e,c)
return c:GetMutualLinkedGroupCount()>0
end
function c25163979.mvfilter1(c)
return c:IsFaceup() and c:IsSetCard(0x112)
end
function c25163979.mvfilter2(c,tp)
return c:IsFaceup() and c:IsSetCard(0x112) and c:GetSequence()<5
and Duel.IsExistingMatchingCard(c25163979.mvfilter3,tp,LOCATION_MZONE,0,1,c)
end
function c25163979.mvfilter3(c)
return c:IsFaceup() and c:IsSetCard(0x112) and c:GetSequence()<5
end
function c25163979.mvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c25163979.mvfilter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0
local b2=Duel.IsExistingMatchingCard(c25163979.mvfilter2,tp,LOCATION_MZONE,0,1,nil,tp)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(25163979,1),aux.Stringid(25163979,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(25163979,1))
else op=Duel.SelectOption(tp,aux.Stringid(25163979,2))+1 end
e:SetLabel(op)
end
function c25163979.mvop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25163979,3))
local g=Duel.SelectMatchingCard(tp,c25163979.mvfilter1,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(g:GetFirst(),nseq)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectMatchingCard(tp,c25163979.mvfilter2,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc1=g1:GetFirst()
if not tc1 then return end
Duel.HintSelection(g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g2=Duel.SelectMatchingCard(tp,c25163979.mvfilter3,tp,LOCATION_MZONE,0,1,1,tc1)
Duel.HintSelection(g2)
local tc2=g2:GetFirst()
Duel.SwapSequence(tc1,tc2)
end
end
--剛鬼フェイスターン
function c26285557.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,26285557+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c26285557.target)
e1:SetOperation(c26285557.activate)
c:RegisterEffect(e1)
end
function c26285557.desfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xfc) and Duel.GetMZoneCount(tp,c)>0
end
function c26285557.spfilter(c,e,tp)
return c:IsSetCard(0xfc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c26285557.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c26285557.desfilter,tp,LOCATION_ONFIELD,0,1,c,tp)
and Duel.IsExistingTarget(c26285557.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c26285557.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c26285557.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0)
e:SetLabelObject(g1:GetFirst())
end
function c26285557.activate(e,tp,eg,ep,ev,re,r,rp)
local tc1,tc2=Duel.GetFirstTarget()
if tc1~=e:GetLabelObject() then tc1,tc2=tc2,tc1 end
if tc1:IsControler(tp) and tc1:IsRelateToEffect(e) and Duel.Destroy(tc1,REASON_EFFECT)>0 and tc2:IsRelateToEffect(e) then
Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP)
end
end
--トロイメア・フェニックス
function c2857636.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c2857636.lcheck)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2857636,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,2857636)
e1:SetCondition(c2857636.descon)
e1:SetCost(c2857636.descost)
e1:SetTarget(c2857636.destg)
e1:SetOperation(c2857636.desop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c2857636.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c2857636.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c2857636.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c2857636.descost(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 c2857636.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_DESTROY)
e:SetLabel(0)
end
end
function c2857636.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0
and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(2857636,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c2857636.indtg(e,c)
return c:GetMutualLinkedGroupCount()>0
end
--剛鬼ザ・マスター・オーガ
function c30286474.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfc),2)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(30286474,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,0x1c0)
e1:SetCountLimit(1)
e1:SetCost(c30286474.discost)
e1:SetTarget(c30286474.distg)
e1:SetOperation(c30286474.disop)
c:RegisterEffect(e1)
--attack all
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetValue(1)
c:RegisterEffect(e2)
--attack limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetCondition(c30286474.atcon)
e3:SetValue(c30286474.atlimit)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e4:SetCondition(c30286474.atcon)
c:RegisterEffect(e4)
end
function c30286474.discost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c30286474.costfilter(c,g)
return c:IsFaceup() and c:IsSetCard(0xfc) and g:IsContains(c) and c:IsAbleToHandAsCost()
end
function c30286474.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lg=e:GetHandler():GetLinkedGroup()
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and aux.disfilter1(chkc) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c30286474.costfilter,tp,LOCATION_MZONE,0,1,nil,lg)
and Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil)
else return false end
end
e:SetLabel(0)
local rt=Duel.GetTargetCount(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local cg=Duel.SelectMatchingCard(tp,c30286474.costfilter,tp,LOCATION_MZONE,0,1,rt,nil,lg)
local ct=cg:GetCount()
Duel.SendtoHand(cg,nil,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c30286474.disfilter(c,e)
return ((c:IsFaceup() and not c:IsDisabled()) or c:IsType(TYPE_TRAPMONSTER)) and c:IsRelateToEffect(e)
end
function c30286474.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c30286474.disfilter,nil,e)
local tc=g:GetFirst()
while tc 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
tc=g:GetNext()
end
end
function c30286474.atcon(e)
return Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil)
end
function c30286474.atlimit(e,c)
local g=Duel.GetMatchingGroup(Card.IsFaceup,e:GetHandlerPlayer(),0,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetAttack)
return not tg:IsContains(c) or c:IsFacedown()
end
--トロイメア・マーメイド
function c3679218.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c3679218.matfilter,1,1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(3679218,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,3679218)
e1:SetCondition(c3679218.spcon)
e1:SetCost(c3679218.spcost)
e1:SetTarget(c3679218.sptg)
e1:SetOperation(c3679218.spop)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c3679218.atktg)
e2:SetValue(-1000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
function c3679218.matfilter(c)
return c:IsLinkSetCard(0x112) and not c:IsLinkCode(3679218)
end
function c3679218.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c3679218.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c3679218.spfilter(c,e,tp)
return c:IsSetCard(0x112) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c3679218.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c3679218.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetLabel(0)
end
end
function c3679218.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,c3679218.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(3679218,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c3679218.atktg(e,c)
return c:GetMutualLinkedGroupCount()==0
end
--サイバーサル・サイクロン
function c37007105.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c37007105.target)
e1:SetOperation(c37007105.activate)
c:RegisterEffect(e1)
end
function c37007105.filter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_LINK)
and Duel.IsExistingMatchingCard(c37007105.rmfilter,tp,LOCATION_GRAVE,0,1,nil,c:GetLink())
end
function c37007105.rmfilter(c,link)
return c:IsType(TYPE_MONSTER) and c:IsLink(link) and c:IsAbleToRemove()
end
function c37007105.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c37007105.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c37007105.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c37007105.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c37007105.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c37007105.rmfilter),tp,LOCATION_GRAVE,0,1,1,nil,tc:GetLink())
local rc=g:GetFirst()
if rc and Duel.Remove(rc,0,REASON_EFFECT)~=0 and rc:IsLocation(LOCATION_REMOVED)
and Duel.Destroy(tc,REASON_EFFECT)~=0 and bit.band(rc:GetOriginalRace(),RACE_CYBERSE)>0 then
local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_SZONE,nil)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(37007105,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=sg:Select(tp,1,1,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
--ヴァンパイア・サッカー
function c37129797.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_ZOMBIE),2,2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37129797,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,37129797)
e1:SetTarget(c37129797.sptg)
e1:SetOperation(c37129797.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37129797,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,37129798)
e2:SetCondition(c37129797.drcon)
e2:SetTarget(c37129797.drtg)
e2:SetOperation(c37129797.drop)
c:RegisterEffect(e2)
--extra material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_ZOMBIE))
e3:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_HAND,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
end
function c37129797.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function c37129797.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c37129797.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsExistingTarget(c37129797.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c37129797.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c37129797.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_ZOMBIE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
end
function c37129797.drfilter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsPreviousLocation(LOCATION_GRAVE)
end
function c37129797.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c37129797.drfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c37129797.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 c37129797.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
--トリックスター・デビルフィニウム
function c3792766.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfb),2)
c:EnableReviveLimit()
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c3792766.thcon)
e1:SetTarget(c3792766.thtg)
e1:SetOperation(c3792766.thop)
c:RegisterEffect(e1)
end
function c3792766.lkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xfb)
end
function c3792766.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroup():IsExists(c3792766.lkfilter,1,nil)
end
function c3792766.filter(c)
return c:IsFaceup() and c:IsSetCard(0xfb) and c:IsAbleToHand()
end
function c3792766.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c3792766.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c3792766.filter,tp,LOCATION_REMOVED,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_LINK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK)
local g=Duel.SelectTarget(tp,c3792766.filter,tp,LOCATION_REMOVED,0,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c3792766.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoHand(rg,nil,REASON_EFFECT)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
if ct>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e1:SetValue(ct*1000)
c:RegisterEffect(e1)
end
end
end
--トロイメア・ユニコーン
function c38342335.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,c38342335.lcheck)
c:EnableReviveLimit()
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(38342335,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,38342335)
e1:SetCondition(c38342335.tdcon)
e1:SetCost(c38342335.tdcost)
e1:SetTarget(c38342335.tdtg)
e1:SetOperation(c38342335.tdop)
c:RegisterEffect(e1)
--draw count
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DRAW_COUNT)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetValue(c38342335.drval)
c:RegisterEffect(e2)
end
function c38342335.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c38342335.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c38342335.tdcost(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 c38342335.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_TODECK)
e:SetLabel(0)
end
end
function c38342335.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0
and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(38342335,1)) then
Duel.BreakEffect()
if tc:IsLocation(LOCATION_DECK) and tc:IsControler(tp) then
Duel.ShuffleDeck(tp)
end
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c38342335.drfilter(c)
return c:IsFaceup() and c:IsSetCard(0x112) and c:GetMutualLinkedGroupCount()>0
end
function c38342335.drval(e)
local g=Duel.GetMatchingGroup(c38342335.drfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()<=0 then return 1 end
return g:GetClassCount(Card.GetCode)
end
--トロイメア・ゴブリン
function c39064822.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c39064822.lcheck)
c:EnableReviveLimit()
--extra summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(39064822,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c39064822.sumcon)
e1:SetCost(c39064822.sumcost)
e1:SetTarget(c39064822.sumtg)
e1:SetOperation(c39064822.sumop)
c:RegisterEffect(e1)
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c39064822.tgtg)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c39064822.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c39064822.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c39064822.sumcost(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 c39064822.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) end
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(0)
e:SetLabel(0)
end
end
function c39064822.sumop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(39064822,1)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
if Duel.GetFlagEffect(tp,39064822)~=0 then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(39064822,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetLabelObject(c)
e1:SetCondition(c39064822.sumcon2)
e1:SetValue(c39064822.sumval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,39064822,RESET_PHASE+PHASE_END,0,1)
end
function c39064822.sumcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():IsLocation(LOCATION_MZONE)
end
function c39064822.sumval(e,c)
local c=e:GetLabelObject()
local sumzone=c:GetLinkedZone()
local relzone=-bit.lshift(1,c:GetSequence())
return 0,sumzone,relzone
end
function c39064822.tgtg(e,c)
return c:GetMutualLinkedGroupCount()>0
end
--トリックスター・ベラマドンナ
function c41302052.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfb),2)
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:SetCondition(c41302052.imcon)
e1:SetValue(c41302052.immval)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(41302052,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,41302052)
e2:SetCondition(c41302052.damcon)
e2:SetTarget(c41302052.damtg)
e2:SetOperation(c41302052.damop)
c:RegisterEffect(e2)
end
function c41302052.imcon(e)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and c:GetLinkedGroupCount()==0
end
function c41302052.immval(e,te)
return te:GetOwner()~=e:GetHandler() and te:IsActivated()
end
function c41302052.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroupCount()==0
end
function c41302052.damfilter(c)
return c:IsSetCard(0xfb) and c:IsType(TYPE_MONSTER)
end
function c41302052.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41302052.damfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(c41302052.damfilter,tp,LOCATION_GRAVE,0,nil)
local dam=g:GetClassCount(Card.GetCode)*200
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c41302052.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(c41302052.damfilter,tp,LOCATION_GRAVE,0,nil)
local dam=g:GetClassCount(Card.GetCode)*200
Duel.Damage(p,dam,REASON_EFFECT)
end
--オルターガイスト・マルチフェイカー
function c42790071.initial_effect(c)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(42790071,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCountLimit(1,42790071)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c42790071.spcon1)
e2:SetTarget(c42790071.sptg1)
e2:SetOperation(c42790071.spop1)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(42790071,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,42790072)
e3:SetCost(c42790071.spcost)
e3:SetTarget(c42790071.sptg2)
e3:SetOperation(c42790071.spop2)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(42790071,ACTIVITY_SPSUMMON,c42790071.counterfilter)
if not c42790071.global_check then
c42790071.global_check=true
local ex1=Effect.GlobalEffect()
ex1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex1:SetCode(EVENT_CHAINING)
ex1:SetCondition(c42790071.regcon)
ex1:SetOperation(c42790071.regop)
Duel.RegisterEffect(ex1,0)
local ex2=Effect.GlobalEffect()
ex2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex2:SetCode(EVENT_CHAIN_NEGATED)
ex2:SetCondition(c42790071.regcon)
ex2:SetOperation(c42790071.regop2)
Duel.RegisterEffect(ex2,0)
end
end
function c42790071.regcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
end
function c42790071.regop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
c42790071[cid]=true
end
function c42790071.regop2(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
c42790071[cid]=false
end
function c42790071.counterfilter(c)
return c:IsSetCard(0x103)
end
function c42790071.spcon1(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
return c42790071[cid] and rp==tp
end
function c42790071.sptg1(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 c42790071.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c42790071.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(42790071,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c42790071.splimit)
Duel.RegisterEffect(e1,tp)
end
function c42790071.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x103)
end
function c42790071.filter(c,e,tp)
return c:IsSetCard(0x103) and not c:IsCode(42790071) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c42790071.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c42790071.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c42790071.spop2(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,c42790071.filter,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 c43464884.initial_effect(c)
--change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(43464884,0))
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,43464884)
e1:SetCost(c43464884.cost)
e1:SetTarget(c43464884.cgtg)
e1:SetOperation(c43464884.cgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(43464884,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,43464885)
e3:SetCost(c43464884.cost)
e3:SetTarget(c43464884.sptg)
e3:SetOperation(c43464884.spop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(43464884,ACTIVITY_SPSUMMON,c43464884.counterfilter)
end
function c43464884.counterfilter(c)
return c:IsRace(RACE_BEASTWARRIOR)
end
function c43464884.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(43464884,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(c43464884.splimit)
Duel.RegisterEffect(e1,tp)
end
function c43464884.splimit(e,c)
return not c:IsRace(RACE_BEASTWARRIOR)
end
function c43464884.cgfilter(c,mc)
return c:IsRace(RACE_BEASTWARRIOR) and c:GetLevel()>0 and not (c:GetLevel()==mc:GetLevel() and c:IsAttribute(mc:GetAttribute()))
end
function c43464884.cgtg(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_GRAVE) and c43464884.cgfilter(chkc,c) end
if chk==0 then return Duel.IsExistingTarget(c43464884.cgfilter,tp,LOCATION_GRAVE,0,1,nil,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c43464884.cgfilter,tp,LOCATION_GRAVE,0,1,1,nil,c)
end
function c43464884.cgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
local lv=tc:GetLevel()
local att=tc:GetAttribute()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(att)
c:RegisterEffect(e2)
end
end
function c43464884.spfilter(c,e,tp,mc)
return c:IsLevel(mc:GetLevel()) and c:IsRace(mc:GetRace()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c43464884.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c43464884.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c43464884.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,c43464884.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,e:GetHandler())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--太陽電池メン
function c44586426.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(44586426,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,44586426)
e1:SetTarget(c44586426.tgtg)
e1:SetOperation(c44586426.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--token
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(44586426,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCountLimit(1,44586427)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c44586426.tkcon)
e3:SetTarget(c44586426.tktg)
e3:SetOperation(c44586426.tkop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--name
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(44586426,2))
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCountLimit(1,44586428)
e5:SetTarget(c44586426.nmtg)
e5:SetOperation(c44586426.nmop)
c:RegisterEffect(e5)
end
function c44586426.tgfilter(c)
return c:IsRace(RACE_THUNDER) and c:IsAbleToGrave()
end
function c44586426.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c44586426.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c44586426.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c44586426.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c44586426.tkcfilter(c)
return c:IsFaceup() and c:IsRace(RACE_THUNDER)
end
function c44586426.tkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c44586426.tkcfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c44586426.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c44586426.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,44586427,0,0x4011,0,0,1,RACE_THUNDER,ATTRIBUTE_LIGHT) then return end
local token=Duel.CreateToken(tp,44586427)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
function c44586426.nmfilter(c,cd)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsType(TYPE_EFFECT)
and c:IsOriginalSetCard(0x28) and c:GetOriginalCode()~=cd
end
function c44586426.nmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local cd=e:GetHandler():GetCode()
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c44586426.nmfilter(chkc,cd) end
if chk==0 then return Duel.IsExistingTarget(c44586426.nmfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,cd) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c44586426.nmfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,cd)
end
function c44586426.nmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and (tc:IsLocation(LOCATION_GRAVE) or tc:IsFaceup()) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(tc:GetOriginalCode())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--ボイコットン
function c45025640.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c45025640.damcon)
e1:SetOperation(c45025640.damop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DAMAGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c45025640.thcon)
e2:SetTarget(c45025640.thtg)
e2:SetOperation(c45025640.thop)
c:RegisterEffect(e2)
end
function c45025640.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c45025640.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(1-ep,ev,false)
Duel.ChangeBattleDamage(ep,0,false)
end
function c45025640.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep==tp and bit.band(r,REASON_BATTLE)~=0
and (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c)
and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c45025640.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c45025640.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
--エレメントセイバー・モーレフ
function c45702014.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(45702014,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,0x1e0)
e1:SetCost(c45702014.setcost)
e1:SetTarget(c45702014.settg)
e1:SetOperation(c45702014.setop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(45702014,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c45702014.atttg)
e2:SetOperation(c45702014.attop)
c:RegisterEffect(e2)
end
function c45702014.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c45702014.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c45702014.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c45702014.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c45702014.setfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c45702014.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c45702014.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c45702014.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c45702014.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c45702014.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
function c45702014.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c45702014.attop(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_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--鉄騎龍ティアマトン
function c46247282.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(46247282,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,46247282)
e2:SetCondition(c46247282.spcon)
e2:SetTarget(c46247282.sptg)
e2:SetOperation(c46247282.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(46247282,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c46247282.destg)
e3:SetOperation(c46247282.desop)
c:RegisterEffect(e3)
--disable field
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_DISABLE_FIELD)
e4:SetOperation(c46247282.disop)
c:RegisterEffect(e4)
end
function c46247282.cfilter(c)
return c:GetColumnGroupCount()>1
end
function c46247282.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c46247282.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c46247282.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,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c46247282.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)~=0 then
c:CompleteProcedure()
end
end
function c46247282.desfilter(c,g)
return g:IsContains(c)
end
function c46247282.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local cg=e:GetHandler():GetColumnGroup()
local g=Duel.GetMatchingGroup(c46247282.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c46247282.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cg=c:GetColumnGroup()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local g=Duel.GetMatchingGroup(c46247282.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
function c46247282.disop(e,tp)
local c=e:GetHandler()
local flag1=bit.band(c:GetColumnZone(LOCATION_MZONE),0xffffff00)
local flag2=bit.band(bit.lshift(c:GetColumnZone(LOCATION_SZONE),8),0xffff00ff)
local flag3=bit.band(c:GetColumnZone(LOCATION_MZONE),0xff00ffff)
local flag4=bit.band(bit.lshift(c:GetColumnZone(LOCATION_SZONE),8),0xffff)
return flag1+flag2+flag3+flag4
end
--エレメントセイバー・ナル
function c46425662.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46425662,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetCost(c46425662.thcost)
e1:SetTarget(c46425662.thtg)
e1:SetOperation(c46425662.thop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(46425662,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c46425662.atttg)
e2:SetOperation(c46425662.attop)
c:RegisterEffect(e2)
end
function c46425662.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c46425662.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c46425662.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c46425662.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c46425662.thfilter(c)
return (c:IsSetCard(0x400d) or c:IsSetCard(0x113)) and c:IsType(TYPE_MONSTER) and not c:IsCode(46425662) and c:IsAbleToHand()
end
function c46425662.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c46425662.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c46425662.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c46425662.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c46425662.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c46425662.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c46425662.attop(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_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--星遺物-『星槍』
function c46647144.initial_effect(c)
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46647144,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,46647144)
e1:SetCondition(c46647144.atkcon)
e1:SetCost(c46647144.atkcost)
e1:SetOperation(c46647144.atkop)
c:RegisterEffect(e1)
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(c46647144.atktg)
c:RegisterEffect(e2)
--token
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(46647144,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,46647145)
e3:SetCondition(c46647144.tkcon)
e3:SetTarget(c46647144.tktg)
e3:SetOperation(c46647144.tkop)
c:RegisterEffect(e3)
end
function c46647144.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a:IsControler(1-tp) then a,d=d,a end
e:SetLabelObject(d)
local g=Group.FromCards(a,d)
return a and d and a:IsRelateToBattle() and d:IsRelateToBattle() and g:IsExists(Card.IsType,1,nil,TYPE_LINK)
end
function c46647144.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c46647144.atkop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject()
if tc:IsFaceup() and tc:IsRelateToBattle() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-3000)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
function c46647144.atktg(e,c)
return c:IsFaceup() and c:IsSetCard(0xfe) and c~=e:GetHandler()
end
function c46647144.cfilter(c,tp)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function c46647144.tkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c46647144.cfilter,1,nil,tp)
end
function c46647144.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function c46647144.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,46647145,0xfe,0x4011,0,0,1,RACE_MACHINE,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,46647145,0xfe,0x4011,0,0,1,RACE_MACHINE,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE,1-tp)
or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local token1=Duel.CreateToken(tp,46647145)
local token2=Duel.CreateToken(tp,46647145)
Duel.SpecialSummonStep(token1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
Duel.SpecialSummonStep(token2,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
Duel.SpecialSummonComplete()
end
--無情なはたき落とし
function c47439573.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetCode(EVENT_TO_HAND)
e1:SetCondition(c47439573.condition)
e1:SetTarget(c47439573.target)
e1:SetOperation(c47439573.activate)
c:RegisterEffect(e1)
end
function c47439573.cfilter(c,tp)
return c:IsControler(tp) and c:IsReason(REASON_EFFECT) and (c:IsPreviousLocation(LOCATION_GRAVE) or (c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)))
end
function c47439573.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c47439573.cfilter,1,nil,1-tp)
end
function c47439573.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,1-tp,1)
end
function c47439573.filter(c,e,tp)
return c:IsRelateToEffect(e) and c47439573.cfilter(c,tp)
end
function c47439573.rmfilter(c,g)
return c:IsAbleToRemove() and g:IsExists(Card.IsCode,1,nil,c:GetCode())
end
function c47439573.activate(e,tp,eg,ep,ev,re,r,rp)
local dg=eg:Filter(c47439573.filter,nil,e,1-tp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
local tg=g:Filter(c47439573.rmfilter,nil,dg)
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
Duel.ShuffleHand(1-tp)
end
end
--神属の堕天使
function c48152161.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,48152161+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c48152161.cost)
e1:SetTarget(c48152161.target)
e1:SetOperation(c48152161.activate)
c:RegisterEffect(e1)
end
function c48152161.costfilter(c)
return c:IsSetCard(0xef)
and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c48152161.filter,0,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function c48152161.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48152161.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c48152161.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c48152161.filter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
end
function c48152161.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48152161.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,0)
end
function c48152161.activate(e,tp,eg,ep,ev,re,r,rp)
local exc=nil
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then exc=e:GetHandler() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c48152161.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,exc)
if g:GetCount()>0 then
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
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(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local atk=tc:GetAttack()
if atk>0 then
Duel.Recover(tp,atk,REASON_EFFECT)
end
end
end
--スペース・インシュレイター
function c4914353.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,2)
--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(c4914353.tgtg)
e1:SetValue(-800)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(4914353,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c4914353.spcon)
e3:SetTarget(c4914353.sptg)
e3:SetOperation(c4914353.spop)
c:RegisterEffect(e3)
end
function c4914353.tgtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c4914353.cfilter(c,tp)
return c:IsControler(tp) and c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK)
end
function c4914353.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c4914353.cfilter,1,nil,tp) and aux.exccon(e)
end
function c4914353.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=0
local lg=eg:Filter(c4914353.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetLinkedZone())
end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c4914353.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=0
local lg=eg:Filter(c4914353.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetLinkedZone())
end
if c:IsRelateToEffect(e) and zone~=0 and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP,zone) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
e2:SetReset(RESET_EVENT+0x47e0000)
c:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
--取捨蘇生
function c50213848.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,50213848+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c50213848.target)
e1:SetOperation(c50213848.activate)
c:RegisterEffect(e1)
end
function c50213848.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsAbleToRemove()
end
function c50213848.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c50213848.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c50213848.filter,tp,LOCATION_GRAVE,0,3,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c50213848.filter,tp,LOCATION_GRAVE,0,3,3,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c50213848.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e):Filter(Card.IsCanBeSpecialSummoned,nil,e,0,tp,false,false)
if g:GetCount()==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local tc=g:Select(1-tp,1,1,nil):GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
g:RemoveCard(tc)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
--デグレネード・バスター
function c50426119.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c50426119.sprcon)
e1:SetOperation(c50426119.sprop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50426119,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,0x1e0)
e2:SetCountLimit(1,50426119)
e2:SetTarget(c50426119.rmtg)
e2:SetOperation(c50426119.rmop)
c:RegisterEffect(e2)
end
function c50426119.sprfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsAbleToRemoveAsCost()
end
function c50426119.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c50426119.sprfilter,tp,LOCATION_GRAVE,0,2,nil)
end
function c50426119.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c50426119.sprfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c50426119.rmfilter(c,atk)
return c:IsFaceup() and c:GetAttack()>atk and c:IsAbleToRemove()
end
function c50426119.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local atk=e:GetHandler():GetAttack()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c50426119.rmfilter(chkc,atk) end
if chk==0 then return Duel.IsExistingTarget(c50426119.rmfilter,tp,0,LOCATION_MZONE,1,nil,atk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c50426119.rmfilter,tp,0,LOCATION_MZONE,1,1,nil,atk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c50426119.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
tc:RegisterFlagEffect(50426119,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetCondition(c50426119.retcon)
e1:SetOperation(c50426119.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c50426119.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(50426119)~=0
end
function c50426119.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
--プロンプトホーン
function c50548657.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50548657,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,50548657)
e1:SetCost(c50548657.spcost)
e1:SetTarget(c50548657.sptg)
e1:SetOperation(c50548657.spop)
c:RegisterEffect(e1)
end
function c50548657.costfilter(c,e,tp,g,ft)
local lv=c:GetLevel()
return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE) and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
and g:CheckWithSumEqual(Card.GetLevel,lv,1,ft+1)
end
function c50548657.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c50548657.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c50548657.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c50548657.costfilter,1,nil,e,tp,g,ft) end
local sg=Duel.SelectReleaseGroup(tp,c50548657.costfilter,1,1,nil,e,tp,g,ft)
e:SetLabel(sg:GetFirst():GetLevel())
Duel.Release(sg,REASON_COST)
end
function c50548657.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c50548657.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c50548657.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if ft<=0 or g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectWithSumEqual(tp,Card.GetLevel,e:GetLabel(),1,ft)
if sg:GetCount()>0 then
local fid=e:GetHandler():GetFieldID()
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(50548657,RESET_EVENT+0x1fe0000,0,1,fid)
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
sg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(sg)
e1:SetCondition(c50548657.rmcon)
e1:SetOperation(c50548657.rmop)
Duel.RegisterEffect(e1,tp)
end
end
function c50548657.rmfilter(c,fid)
return c:GetFlagEffectLabel(50548657)==fid
end
function c50548657.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c50548657.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c50548657.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c50548657.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
--バウンドリンク
function c51335426.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c51335426.target)
e1:SetOperation(c51335426.activate)
c:RegisterEffect(e1)
end
function c51335426.filter(c,tp)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_LINK) and c:IsAbleToExtra() and Duel.IsPlayerCanDraw(tp,c:GetLink())
end
function c51335426.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c51335426.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c51335426.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c51335426.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(g:GetFirst():GetLink())
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,g:GetFirst():GetLink())
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,g:GetFirst():GetLink())
end
function c51335426.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local tc=Duel.GetFirstTarget()
local ct=tc:GetLink()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_EXTRA) then
if Duel.Draw(p,ct,REASON_EFFECT)==ct then
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,ct,ct,nil)
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
Duel.SortDecktop(p,p,ct)
for i=1,ct do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),1)
end
end
end
end
--オルターガイスト・ピクシール
function c57769391.initial_effect(c)
--mill
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(57769391,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,57769391)
e1:SetCost(c57769391.cost)
e1:SetTarget(c57769391.target)
e1:SetOperation(c57769391.operation)
c:RegisterEffect(e1)
end
function c57769391.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c57769391.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
end
function c57769391.filter(c)
return c:IsAbleToHand() and c:IsSetCard(0x103)
end
function c57769391.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,3) then return end
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then
Duel.DisableShuffleCheck()
if g:IsExists(c57769391.filter,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c57769391.filter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
g:Sub(sg)
end
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
end
end
--星遺物への抵抗
function c58374719.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c58374719.target)
e1:SetOperation(c58374719.activate)
c:RegisterEffect(e1)
end
function c58374719.cfilter(c)
return c:GetMutualLinkedGroupCount()>0
end
function c58374719.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingMatchingCard(c58374719.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
local ct=Duel.GetMatchingGroupCount(c58374719.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c58374719.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT)
end
--デフラドラグーン
function c58582979.initial_effect(c)
--special summon (hand)
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:SetCountLimit(1,58582979)
e1:SetCondition(c58582979.hspcon)
e1:SetOperation(c58582979.hspop)
c:RegisterEffect(e1)
--special summon (grave)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,58582980)
e2:SetCost(c58582979.spcost)
e2:SetTarget(c58582979.sptg)
e2:SetOperation(c58582979.spop)
c:RegisterEffect(e2)
end
function c58582979.hspcfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c58582979.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c58582979.hspcfilter,tp,LOCATION_HAND,0,1,c)
end
function c58582979.hspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c58582979.hspcfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
end
function c58582979.spcfilter1(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c58582979.spcfilter2,tp,LOCATION_GRAVE,0,2,c,c:GetCode())
end
function c58582979.spcfilter2(c,code)
return c:IsCode(code) and c:IsAbleToRemoveAsCost()
end
function c58582979.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c58582979.spcfilter1,tp,LOCATION_GRAVE,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c58582979.spcfilter1,tp,LOCATION_GRAVE,0,1,1,c,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c58582979.spcfilter2,tp,LOCATION_GRAVE,0,2,2,g:GetFirst(),g:GetFirst():GetCode())
g:Merge(g2)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c58582979.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 c58582979.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--ジェルゴンヌの終焉
function c59490397.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c59490397.cost)
e1:SetTarget(c59490397.target)
e1:SetOperation(c59490397.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(59490397,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c59490397.descon)
e2:SetTarget(c59490397.destg)
e2:SetOperation(c59490397.desop)
c:RegisterEffect(e2)
end
function c59490397.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(c59490397.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function c59490397.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
e:GetOwner():CancelToGrave(false)
end
function c59490397.filter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSetCard(0x10b)
end
function c59490397.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c59490397.filter(chkc) end
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingTarget(c59490397.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c59490397.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c59490397.eqlimit(e,c)
return c:GetControler()==e:GetHandlerPlayer() and c:IsType(TYPE_LINK) and c:IsSetCard(0x10b)
end
function c59490397.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(c59490397.eqlimit)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
else
c:CancelToGrave(false)
end
end
function c59490397.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetEquipTarget()
return tc and tc:GetLinkedGroupCount()==tc:GetLink()
end
function c59490397.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetEquipTarget()
if chk==0 then return tc:GetLinkedGroupCount()>0 end
local lg=tc:GetLinkedGroup()
lg:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,lg,lg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,tc:GetAttack())
end
function c59490397.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetEquipTarget()
if not c:IsRelateToEffect(e) or not tc then return end
local atk=tc:GetAttack()
local lg=tc:GetLinkedGroup()
lg:AddCard(c)
local ct=lg:GetCount()
if ct>0 then
local dc=Duel.Destroy(lg,REASON_EFFECT)
if dc==ct then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
--トリックスター・シャクナージュ
function c59604521.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(59604521,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,59604521)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c59604521.spcost)
e1:SetTarget(c59604521.sptg)
e1:SetOperation(c59604521.spop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(59604521,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_REMOVE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c59604521.damcon)
e2:SetOperation(c59604521.damop)
c:RegisterEffect(e2)
end
function c59604521.cfilter(c)
return c:IsSetCard(0xfb) and c:IsDiscardable()
end
function c59604521.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c59604521.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c59604521.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c59604521.filter(c,e,tp)
return c:IsSetCard(0xfb) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c59604521.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c59604521.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c59604521.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c59604521.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c59604521.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c59604521.damfilter(c,tp)
return c:IsPreviousLocation(LOCATION_GRAVE) and c:GetPreviousControler()==1-tp
end
function c59604521.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c59604521.damfilter,1,nil,tp)
end
function c59604521.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,59604521)
local ct=eg:FilterCount(c59604521.damfilter,nil,tp)
Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end
--霊神の聖殿
function c61557074.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--boost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(c61557074.atkval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(61557074,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetTarget(c61557074.thtg)
e4:SetOperation(c61557074.thop)
c:RegisterEffect(e4)
--change cost
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(61557074,1))
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(61557074)
e5:SetRange(LOCATION_FZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,0)
e5:SetCondition(c61557074.condition)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_CLIENT_HINT)
c:RegisterEffect(e6)
end
function c61557074.atkval(e,c)
return Duel.GetMatchingGroup(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_MONSTER):GetClassCount(Card.GetAttribute)*200
end
function c61557074.thfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c61557074.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c61557074.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c61557074.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,c61557074.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
if Duel.GetTurnPlayer()==tp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c61557074.skipcon)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
end
function c61557074.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
function c61557074.condition(e)
return e:GetHandler():GetFlagEffect(61557074)==0
end
--星遺物が導く果て
function c62279666.initial_effect(c)
c:SetUniqueOnField(1,0,62279666)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(62279666,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c62279666.spcon)
e2:SetTarget(c62279666.sptg)
e2:SetOperation(c62279666.spop)
c:RegisterEffect(e2)
end
function c62279666.cfilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and bit.band(c:GetPreviousTypeOnField(),TYPE_LINK)~=0
and (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT)))
end
function c62279666.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c62279666.cfilter,1,nil,tp,rp)
end
function c62279666.spfilter(c,e,tp)
return c:IsSetCard(0xfe) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c62279666.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c62279666.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c62279666.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c62279666.spfilter,tp,LOCATION_DECK+LOCATION_HAND,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 c63492244.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(63492244,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,63492244)
e2:SetCondition(c63492244.spcon)
e2:SetTarget(c63492244.sptg)
e2:SetOperation(c63492244.spop)
c:RegisterEffect(e2)
--lock
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(63492244,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,63492245)
e3:SetTarget(c63492244.target)
e3:SetOperation(c63492244.operation)
c:RegisterEffect(e3)
end
function c63492244.spcon(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
return ec:IsSetCard(0xfb) and ec:IsSummonType(SUMMON_TYPE_LINK) and ec:GetSummonPlayer()==tp
end
function c63492244.spfilter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsSetCard(0xfb)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c63492244.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=eg:GetFirst():GetMaterial()
if chkc then return mg:IsContains(chkc) and c63492244.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and mg:IsExists(c63492244.spfilter,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=mg:FilterSelect(tp,c63492244.spfilter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c63492244.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and 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+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
function c63492244.cfilter(c)
return c:IsFacedown() and c:GetSequence()<5
end
function c63492244.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_SZONE) and c63492244.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c63492244.cfilter,tp,0,LOCATION_SZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(63492244,2))
Duel.SelectTarget(tp,c63492244.cfilter,tp,0,LOCATION_SZONE,1,1,e:GetHandler())
end
function c63492244.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFacedown() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
e:SetLabelObject(tc)
c:ResetFlagEffect(63492244)
tc:ResetFlagEffect(63492244)
local fid=c:GetFieldID()
c:RegisterFlagEffect(63492244,RESET_EVENT+0x1fe0000,0,1,fid)
tc:RegisterFlagEffect(63492244,RESET_EVENT+0x1fe0000,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DRAW)
e1:SetLabelObject(tc)
e1:SetCondition(c63492244.rcon)
e1:SetValue(1)
tc:RegisterEffect(e1)
--End of e1
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DRAW)
e2:SetLabel(fid)
e2:SetLabelObject(e1)
e2:SetCondition(c63492244.rstcon)
e2:SetOperation(c63492244.rstop)
Duel.RegisterEffect(e2,tp)
--return to hand
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:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DRAW)
e3:SetLabel(fid)
e3:SetLabelObject(tc)
e3:SetCondition(c63492244.agcon)
e3:SetOperation(c63492244.agop)
Duel.RegisterEffect(e3,1-tp)
--activate check
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_CHAINING)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DRAW)
e4:SetLabel(fid)
e4:SetLabelObject(e3)
e4:SetOperation(c63492244.rstop2)
Duel.RegisterEffect(e4,tp)
end
end
function c63492244.rcon(e)
return e:GetOwner():IsHasCardTarget(e:GetHandler()) and e:GetHandler():GetFlagEffect(63492244)~=0
end
function c63492244.rstcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject():GetLabelObject()
if tc:GetFlagEffectLabel(63492244)==e:GetLabel()
and c:GetFlagEffectLabel(63492244)==e:GetLabel() then
return not c:IsDisabled()
else
e:Reset()
return false
end
end
function c63492244.rstop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
te:Reset()
Duel.HintSelection(Group.FromCards(e:GetHandler()))
end
function c63492244.agcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(63492244)==e:GetLabel()
and c:GetFlagEffectLabel(63492244)==e:GetLabel() then
return not c:IsDisabled()
else
e:Reset()
return false
end
end
function c63492244.agop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
function c63492244.rstop2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffectLabel(63492244)~=e:GetLabel() then return end
local c=e:GetHandler()
c:CancelCardTarget(tc)
local te=e:GetLabelObject()
tc:ResetFlagEffect(63492244)
if te then te:Reset() end
end
--小法師ヒダルマー
function c64514892.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST),2,2)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c64514892.atkval)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(64514892,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetTarget(c64514892.destg)
e2:SetOperation(c64514892.desop)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(64514892,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(aux.bdocon)
e3:SetTarget(c64514892.thtg)
e3:SetOperation(c64514892.thop)
c:RegisterEffect(e3)
end
function c64514892.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
end
function c64514892.atkval(e,c)
return Duel.GetMatchingGroupCount(c64514892.cfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)*100
end
function c64514892.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c64514892.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c64514892.desfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(c64514892.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c64514892.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,c64514892.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function c64514892.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.Destroy(tg,REASON_EFFECT)
end
end
function c64514892.thfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToHand()
end
function c64514892.thtg(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 c64514892.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c64514892.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c64514892.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c64514892.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--トロイメア・グリフォン
function c65330383.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,c65330383.lcheck)
c:EnableReviveLimit()
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(65330383,0))
e1:SetCategory(CATEGORY_LEAVE_GRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,65330383)
e1:SetCondition(c65330383.setcon)
e1:SetCost(c65330383.setcost)
e1:SetTarget(c65330383.settg)
e1:SetOperation(c65330383.setop)
c:RegisterEffect(e1)
--cannot activate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,1)
e2:SetValue(c65330383.aclimit)
c:RegisterEffect(e2)
end
function c65330383.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c65330383.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c65330383.setcost(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 c65330383.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c65330383.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c65330383.setfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c65330383.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c65330383.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_LEAVE_GRAVE+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_LEAVE_GRAVE)
e:SetLabel(0)
end
end
function c65330383.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsSSetable() then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
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)
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(65330383,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c65330383.aclimit(e,re,tp)
local tc=re:GetHandler()
return tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and tc:IsSummonType(SUMMON_TYPE_SPECIAL) and not tc:IsLinkState() and re:IsActiveType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e)
end
--番猫-ウォッチキャット
function c70975131.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(70975131,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,70975131)
e1:SetCondition(c70975131.spcon)
e1:SetTarget(c70975131.sptg)
e1:SetOperation(c70975131.spop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(c70975131.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(70975131,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,70975132)
e3:SetCondition(c70975131.setcon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c70975131.settg)
e3:SetOperation(c70975131.setop)
c:RegisterEffect(e3)
end
function c70975131.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c70975131.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 c70975131.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c70975131.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(70975131,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c70975131.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(70975131)~=0 and Duel.GetTurnPlayer()==tp
end
function c70975131.setfilter(c)
return c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsSSetable()
end
function c70975131.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c70975131.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c70975131.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c70975131.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
Duel.ConfirmCards(1-tp,g)
end
end
--エレメントセイバー・ウィラード
function c71797713.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71797713,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,71797713)
e1:SetCost(c71797713.spcost)
e1:SetTarget(c71797713.sptg)
e1:SetOperation(c71797713.spop)
c:RegisterEffect(e1)
--summon success
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c71797713.regcon)
e2:SetOperation(c71797713.regop)
c:RegisterEffect(e2)
e2:SetLabelObject(e1)
end
function c71797713.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and (c:IsSetCard(0x400d) or c:IsLocation(LOCATION_HAND))
end
function c71797713.regfilter(c,attr)
return c:IsSetCard(0x400d) and bit.band(c:GetOriginalAttribute(),attr)~=0
end
function c71797713.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c71797713.costfilter,tp,loc,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c71797713.costfilter,tp,loc,0,2,2,e:GetHandler())
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
local flag=0
if g:IsExists(c71797713.regfilter,1,nil,ATTRIBUTE_EARTH+ATTRIBUTE_WIND) then flag=bit.bor(flag,0x1) end
if g:IsExists(c71797713.regfilter,1,nil,ATTRIBUTE_WATER+ATTRIBUTE_FIRE) then flag=bit.bor(flag,0x2) end
if g:IsExists(c71797713.regfilter,1,nil,ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) then flag=bit.bor(flag,0x4) end
Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(flag)
end
function c71797713.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 c71797713.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)
end
end
function c71797713.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 and e:GetLabelObject():GetLabel()~=0
end
function c71797713.regop(e,tp,eg,ep,ev,re,r,rp)
local flag=e:GetLabelObject():GetLabel()
local c=e:GetHandler()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(LOCATION_MZONE,0)
e0:SetTarget(c71797713.immtg)
e0:SetReset(RESET_EVENT+0x1fe0000)
if bit.band(flag,0x1)~=0 then
local e1=e0:Clone()
e1:SetDescription(aux.Stringid(71797713,1))
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
end
if bit.band(flag,0x2)~=0 then
local e2=e0:Clone()
e2:SetDescription(aux.Stringid(71797713,2))
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
c:RegisterEffect(e2)
end
if bit.band(flag,0x4)~=0 then
local e3=e0:Clone()
e3:SetDescription(aux.Stringid(71797713,3))
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
end
end
function c71797713.immtg(e,c)
return c:IsSetCard(0x400d) or c:IsSetCard(0x113)
end
--トポロジック・トゥリスバエナ
function c72529749.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
--banish
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(72529749,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c72529749.rmcon)
e1:SetTarget(c72529749.rmtg)
e1:SetOperation(c72529749.rmop)
c:RegisterEffect(e1)
end
function c72529749.cfilter(c,ec)
if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return bit.band(ec:GetLinkedZone(c:GetPreviousControler()),bit.lshift(0x1,c:GetPreviousSequence()))~=0
end
end
function c72529749.rmcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c72529749.cfilter,1,nil,e:GetHandler())
end
function c72529749.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(c72529749.cfilter,nil,e:GetHandler())
local tg=g:Filter(Card.IsLocation,nil,LOCATION_MZONE)
Duel.SetTargetCard(tg)
local g2=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
g:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c72529749.rmop(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)
local g2=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
g:Merge(g2)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,1-tp)
Duel.Damage(1-tp,ct*500,REASON_EFFECT)
end
end
--エレメントセイバー・マロー
function c72819261.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(72819261,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c72819261.sgcost)
e1:SetTarget(c72819261.sgtg)
e1:SetOperation(c72819261.sgop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(72819261,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c72819261.atttg)
e2:SetOperation(c72819261.attop)
c:RegisterEffect(e2)
end
function c72819261.costfilter(c,tp)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c72819261.filter,tp,LOCATION_DECK,0,1,c)
end
function c72819261.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c72819261.costfilter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c72819261.costfilter,tp,loc,0,1,1,nil,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c72819261.filter(c)
return (c:IsSetCard(0x400d) or c:IsSetCard(0x113)) and not c:IsCode(72819261) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c72819261.sgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c72819261.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c72819261.sgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c72819261.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c72819261.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c72819261.attop(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_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--屋敷わらし
function c73642296.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(73642296,0))
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,73642296)
e1:SetCondition(c73642296.discon)
e1:SetCost(c73642296.discost)
e1:SetTarget(c73642296.distg)
e1:SetOperation(c73642296.disop)
c:RegisterEffect(e1)
end
function c73642296.discon(e,tp,eg,ep,ev,re,r,rp)
local ex1,g1,gc1,dp1,dv1=Duel.GetOperationInfo(ev,CATEGORY_TOHAND)
local ex2,g2,gc2,dp2,dv2=Duel.GetOperationInfo(ev,CATEGORY_TODECK)
local ex3,g3,gc3,dp3,dv3=Duel.GetOperationInfo(ev,CATEGORY_TOEXTRA)
local ex4,g4,gc4,dp4,dv4=Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON)
local ex5,g5,gc5,dp5,dv5=Duel.GetOperationInfo(ev,CATEGORY_REMOVE)
return ((ex1 and (bit.band(dv1,LOCATION_GRAVE)==LOCATION_GRAVE or g1 and g1:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)))
or (ex2 and (bit.band(dv2,LOCATION_GRAVE)==LOCATION_GRAVE or g2 and g2:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)))
or (ex3 and (bit.band(dv3,LOCATION_GRAVE)==LOCATION_GRAVE or g3 and g3:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)))
or (ex4 and (bit.band(dv4,LOCATION_GRAVE)==LOCATION_GRAVE or g4 and g4:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)))
or (ex5 and (bit.band(dv5,LOCATION_GRAVE)==LOCATION_GRAVE or g5 and g5:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE))))
and Duel.IsChainNegatable(ev)
end
function c73642296.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c73642296.distg(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)
end
function c73642296.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) then
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then
Duel.SendtoGrave(eg,REASON_EFFECT)
end
end
end
--トロイメア・ケルベロス
function c75452921.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c75452921.lcheck)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75452921,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,75452921)
e1:SetCondition(c75452921.descon)
e1:SetCost(c75452921.descost)
e1:SetTarget(c75452921.destg)
e1:SetOperation(c75452921.desop)
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:SetTarget(c75452921.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c75452921.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c75452921.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c75452921.descost(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 c75452921.desfilter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:GetSequence()<5
end
function c75452921.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c75452921.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75452921.desfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c75452921.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_DESTROY)
e:SetLabel(0)
end
end
function c75452921.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0
and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(75452921,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c75452921.indtg(e,c)
return c:GetMutualLinkedGroupCount()>0
end
--オルターガイスト・キードゥルガー
function c76685519.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x103),2,2)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76685519,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c76685519.spcon)
e1:SetTarget(c76685519.sptg)
e1:SetOperation(c76685519.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(76685519,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetTarget(c76685519.thtg)
e2:SetOperation(c76685519.thop)
c:RegisterEffect(e2)
end
function c76685519.spcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep~=tp and tc:IsControler(tp) and tc:IsSetCard(0x103) and tc~=e:GetHandler()
end
function c76685519.spfilter(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c76685519.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=e:GetHandler():GetLinkedZone(tp)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c76685519.spfilter(chkc,e,tp,zone) end
if chk==0 then return Duel.IsExistingTarget(c76685519.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c76685519.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c76685519.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=c:GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetCondition(c76685519.atkcon)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
function c76685519.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetOwner():GetAttackAnnouncedCount()==0
end
function c76685519.thfilter(c)
return c:IsSetCard(0x103) and c:IsAbleToHand()
end
function c76685519.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c76685519.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c76685519.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectTarget(tp,c76685519.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,1,0,0)
end
function c76685519.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--トリックスター・ブルム
function c77307161.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c77307161.matfilter,1,1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(77307161,0))
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_SPSUMMON_SUCCESS)
e1:SetCondition(c77307161.drcon)
e1:SetTarget(c77307161.drtg)
e1:SetOperation(c77307161.drop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(77307161,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,77307161)
e2:SetCondition(c77307161.damcon)
e2:SetTarget(c77307161.damtg)
e2:SetOperation(c77307161.damop)
c:RegisterEffect(e2)
end
function c77307161.matfilter(c,lc,sumtype,tp)
return c:IsLevelBelow(2) and c:IsLinkSetCard(0xfb)
end
function c77307161.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c77307161.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(1-tp,1) end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,1)
end
function c77307161.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
function c77307161.cfilter(c,tp,zone)
local seq=c:GetPreviousSequence()
if c:GetPreviousControler()~=tp then seq=seq+16 end
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsSetCard(0xfb)
and c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(zone,seq)~=0
end
function c77307161.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c77307161.cfilter,1,nil,tp,e:GetHandler():GetLinkedZone())
end
function c77307161.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)>0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c77307161.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,Duel.GetFieldGroupCount(p,LOCATION_HAND,0)*200,REASON_EFFECT)
end
--トランスファミリア
function c7969770.initial_effect(c)
--move
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7969770,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c7969770.mvtg)
e1:SetOperation(c7969770.mvop)
c:RegisterEffect(e1)
end
function c7969770.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(7969770,1))
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
end
function c7969770.mvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
--光霊神フォスオラージュ
function c8192327.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c8192327.spcon)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(8192327,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,8192327)
e3:SetTarget(c8192327.destg)
e3:SetOperation(c8192327.desop)
c:RegisterEffect(e3)
--leave
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(c8192327.leaveop)
c:RegisterEffect(e4)
end
function c8192327.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.GetMatchingGroupCount(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_LIGHT)==5
end
function c8192327.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0,nil)
end
function c8192327.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c8192327.leaveop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsFacedown() then return end
local effp=e:GetHandler():GetControler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
if Duel.GetTurnPlayer()==effp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c8192327.skipcon)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,effp)
end
function c8192327.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
--エレメントセイバー・アイナ
function c83032858.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(83032858,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c83032858.spcost)
e1:SetTarget(c83032858.sptg)
e1:SetOperation(c83032858.spop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(83032858,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c83032858.atttg)
e2:SetOperation(c83032858.attop)
c:RegisterEffect(e2)
end
function c83032858.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c83032858.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c83032858.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c83032858.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c83032858.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsCode(83032858) and (c:IsSetCard(0x400d) or c:IsSetCard(0x113)) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c83032858.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c83032858.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c83032858.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c83032858.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c83032858.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
function c83032858.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c83032858.attop(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_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--豆まき
function c83828288.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c83828288.target)
e1:SetOperation(c83828288.activate)
c:RegisterEffect(e1)
end
function c83828288.filter(c,tp)
local lv=c:GetLevel()
return lv>0 and c:IsFaceup() and c:IsAbleToDeck() and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=lv and Duel.IsPlayerCanDraw(tp,lv)
end
function c83828288.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 c83828288.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c83828288.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c83828288.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
local lv=g:GetFirst():GetLevel()
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,lv)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,lv)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c83828288.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local lv=tc:GetLevel()
if tc:IsRelateToEffect(e) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=lv then
local ct=Duel.DiscardHand(tp,aux.TRUE,lv,lv,REASON_EFFECT+REASON_DISCARD)
if ct>0 and Duel.Draw(tp,lv,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
--電網の落とし穴
function c84640866.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c84640866.target)
e1:SetOperation(c84640866.activate)
c:RegisterEffect(e1)
end
function c84640866.filter(c,tp)
return c:GetSummonPlayer()~=tp and bit.band(c:GetSummonLocation(),LOCATION_DECK+LOCATION_GRAVE)~=0
and c:IsAbleToRemove() and c:IsLocation(LOCATION_MZONE)
end
function c84640866.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c84640866.filter,nil,tp)
local ct=g:GetCount()
if chk==0 then return ct>0 end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,ct,0,0)
end
function c84640866.activate(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c84640866.filter,nil,tp):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
--バックグランド・ドラゴン
function c84976088.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84976088,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,84976088)
e1:SetCondition(c84976088.spcon)
e1:SetTarget(c84976088.sptg)
e1:SetOperation(c84976088.spop)
c:RegisterEffect(e1)
end
function c84976088.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0
end
function c84976088.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84976088.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c84976088.filter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
end
function c84976088.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84976088.filter,tp,LOCATION_HAND,0,1,1,c,e,tp)
if g:GetCount()>0 then
g:AddCard(c)
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x47e0000)
e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2,true)
end
end
end
--剛鬼マンジロック
function c85008676.initial_effect(c)
--half damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85008676,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(c85008676.damcon)
e1:SetCost(c85008676.damcost)
e1:SetOperation(c85008676.damop)
c:RegisterEffect(e1)
--half damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(85008676,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(aux.damcon1)
e2:SetCost(c85008676.damcost)
e2:SetOperation(c85008676.operation)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(85008676,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,85008676)
e3:SetCondition(c85008676.thcon)
e3:SetTarget(c85008676.thtg)
e3:SetOperation(c85008676.thop)
c:RegisterEffect(e3)
end
function c85008676.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetBattleDamage(tp)>0 and Duel.GetAttacker()~=tp
end
function c85008676.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c85008676.damop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c85008676.dop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c85008676.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,math.ceil(ev/2))
end
function c85008676.operation(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetLabel(cid)
e1:SetValue(c85008676.damcon2)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c85008676.damcon2(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
return cid==e:GetLabel() and math.ceil(val/2) or val
end
function c85008676.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c85008676.thfilter(c)
return c:IsSetCard(0xfc) and not c:IsCode(85008676) and c:IsAbleToHand()
end
function c85008676.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c85008676.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c85008676.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c85008676.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 c85763457.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,85763457+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c85763457.condition)
e1:SetTarget(c85763457.target)
e1:SetOperation(c85763457.activate)
c:RegisterEffect(e1)
end
function c85763457.cfilter(c)
return c:IsFaceup() and c:GetMutualLinkedGroupCount()>0
end
function c85763457.condition(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or not Duel.IsExistingMatchingCard(c85763457.cfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
return Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function c85763457.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 c85763457.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--リミット・コード
function c86607583.initial_effect(c)
c:EnableCounterPermit(0x47)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,86607583+EFFECT_COUNT_CODE_DUEL)
e1:SetCost(c86607583.cost)
e1:SetTarget(c86607583.target)
e1:SetOperation(c86607583.operation)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c86607583.desop)
c:RegisterEffect(e2)
--remove counter
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetCondition(c86607583.rccon)
e3:SetOperation(c86607583.rcop)
c:RegisterEffect(e3)
end
function c86607583.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(c86607583.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function c86607583.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
e:GetOwner():CancelToGrave(false)
end
function c86607583.spfilter(c,e,tp)
return c:IsSetCard(0x101) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c86607583.cfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK)
end
function c86607583.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanAddCounter(tp,0x47,1,e:GetHandler())
and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c86607583.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c86607583.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
local ct=Duel.GetMatchingGroupCount(c86607583.cfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,ct,0,0x47)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c86607583.eqlimit(e,c)
return e:GetLabelObject()==c
end
function c86607583.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetMatchingGroupCount(c86607583.cfilter,tp,LOCATION_GRAVE,0,nil)
if c:IsRelateToEffect(e) and ct>0 and c:IsCanAddCounter(0x47,ct) then
c:AddCounter(0x47,ct)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c86607583.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.Equip(tp,c,tc)
--Add Equip limit
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+0x1fe0000)
e1:SetValue(c86607583.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
Duel.SpecialSummonComplete()
elseif not c:IsStatus(STATUS_LEAVE_CONFIRMED) then
c:CancelToGrave(false)
end
end
end
function c86607583.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c86607583.rccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c86607583.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
if c:IsCanRemoveCounter(tp,0x47,1,REASON_EFFECT) then
c:RemoveCounter(tp,0x47,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
end
end
end
--トリックスター・ヒヨス
function c86825114.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86825114,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCountLimit(1,86825114)
e1:SetCondition(c86825114.spcon)
e1:SetTarget(c86825114.sptg)
e1:SetOperation(c86825114.spop)
c:RegisterEffect(e1)
end
function c86825114.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xfb)
end
function c86825114.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 c86825114.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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
--オルターガイスト・エミュレルフ
function c86885905.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c86885905.target)
e1:SetOperation(c86885905.activate)
c:RegisterEffect(e1)
end
function c86885905.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,86885905,0x103,0x21,1400,1800,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c86885905.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,86885905,0x103,0x21,1400,1800,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) then return end
c:AddMonsterAttribute(TYPE_TRAP+TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
c:AddMonsterAttributeComplete()
--untargetable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c86885905.etarget)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c86885905.etarget)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
function c86885905.etarget(e,c)
return c:IsSetCard(0x103) and c:IsType(TYPE_TRAP) and c~=e:GetHandler()
end
--グレートフライ
function c90512490.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_WIND),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(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_WIND))
e1:SetValue(500)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_EARTH))
e3:SetValue(-400)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
--tohand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(90512490,0))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,90512490)
e5:SetCondition(c90512490.thcon)
e5:SetTarget(c90512490.thtg)
e5:SetOperation(c90512490.thop)
c:RegisterEffect(e5)
end
function c90512490.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c90512490.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToHand()
end
function c90512490.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c90512490.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c90512490.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c90512490.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c90512490.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--にらみ合い
function c97729135.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(97729135,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c97729135.mvcon1)
e2:SetTarget(c97729135.mvtg1)
e2:SetOperation(c97729135.mvop1)
c:RegisterEffect(e2)
--move
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(97729135,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c97729135.mvcon2)
e3:SetTarget(c97729135.mvtg2)
e3:SetOperation(c97729135.mvop2)
c:RegisterEffect(e3)
end
function c97729135.cfilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsPreviousLocation(LOCATION_EXTRA)
end
function c97729135.mvcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c97729135.cfilter,1,nil,tp)
end
function c97729135.mvfilter(c)
return c:GetSequence()<5
end
function c97729135.mvtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=0
local lg=eg:Filter(c97729135.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,1-tp))
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c97729135.mvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97729135.mvfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zone)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(97729135,2))
Duel.SelectTarget(tp,c97729135.mvfilter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c97729135.mvop1(e,tp,eg,ep,ev,re,r,rp)
local zone=0
local lg=eg:Filter(c97729135.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,1-tp))
end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(tp)
or Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zone)<=0 then return end
local flag=bit.bxor(zone,0xff)*0x10000
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,flag)/0x10000
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
function c97729135.mvcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c97729135.cfilter,1,nil,1-tp)
end
function c97729135.mvtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=0
local lg=eg:Filter(c97729135.cfilter,nil,1-tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c97729135.mvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97729135.mvfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zone)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(97729135,2))
Duel.SelectTarget(tp,c97729135.mvfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c97729135.mvop2(e,tp,eg,ep,ev,re,r,rp)
local zone=0
local lg=eg:Filter(c97729135.cfilter,nil,1-tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp)
or Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zone)<=0 then return end
local flag=bit.bxor(zone,0xff)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
--バックアップ・オペレーター
function c97947705.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97947705,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,97947705)
e1:SetTarget(c97947705.sptg)
e1:SetOperation(c97947705.spop)
c:RegisterEffect(e1)
end
function c97947705.lkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c97947705.thfilter(c,g)
return c:IsFaceup() and g:IsContains(c) and c:IsAbleToHand()
end
function c97947705.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Group.CreateGroup()
local lg=Duel.GetMatchingGroup(c97947705.lkfilter,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(lg) do
tg:Merge(tc:GetLinkedGroup())
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c97947705.thfilter(chkc,tg) end
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c97947705.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c97947705.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c97947705.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
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+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
--再臨の帝王
function c98552723.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,98552723+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c98552723.target)
e1:SetOperation(c98552723.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetOperation(c98552723.checkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(c98552723.desop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--double tribute
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_DOUBLE_TRIBUTE)
e4:SetValue(c98552723.condition)
c:RegisterEffect(e4)
end
function c98552723.spfilter(c,e,tp)
return (c:GetAttack()==2400 or c:GetAttack()==2800) and c:GetDefense()==1000 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c98552723.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c98552723.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c98552723.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c98552723.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c98552723.eqlimit(e,c)
return e:GetOwner()==c
end
function c98552723.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if not Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then return end
Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c98552723.eqlimit)
c:RegisterEffect(e1)
--Disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e3)
Duel.SpecialSummonComplete()
end
end
function c98552723.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c98552723.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c98552723.condition(e,c)
return c:IsType(TYPE_MONSTER)
end
--星遺物を継ぐもの
function c99674361.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,99674361+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c99674361.target)
e1:SetOperation(c99674361.activate)
c:RegisterEffect(e1)
end
function c99674361.filter(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c99674361.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=Duel.GetLinkedZone(tp)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c99674361.filter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c99674361.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c99674361.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c99674361.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local zone=Duel.GetLinkedZone(tp)
if tc:IsRelateToEffect(e) and zone~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
--トリックスター・ブーケ
function c99890852.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,99890852)
e1:SetTarget(c99890852.target)
e1:SetOperation(c99890852.activate)
c:RegisterEffect(e1)
end
function c99890852.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xfb)
and c:IsAbleToHand() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function c99890852.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c99890852.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c99890852.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabelObject(g:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c99890852.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=2 then return end
local hc=g:GetFirst()
local tc=g:GetNext()
if hc~=e:GetLabelObject() then tc,hc=hc,tc end
if hc:IsFaceup() and tc:IsFaceup() and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 then
local atk=hc:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment