Commit ad7cd32e authored by argon.sun's avatar argon.sun

new scripts

parent 9dbee05d
--エクシーズ・リベンジ
function c10275411.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:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c10275411.condition)
e1:SetCost(c10275411.cost)
e1:SetTarget(c10275411.target)
e1:SetOperation(c10275411.activate)
c:RegisterEffect(e1)
end
function c10275411.cfilter(c)
return c:IsFaceup() and c:GetOverlayCount()>0
end
function c10275411.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c10275411.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c10275411.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,10275411)==0 end
Duel.RegisterFlagEffect(tp,10275411,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c10275411.filter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10275411.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c10275411.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c10275411.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c10275411.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c10275411.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g1=Duel.GetOverlayGroup(tp,0,1)
if g1:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(10275411,0))
local mg=g1:Select(tp,1,1,nil)
Duel.Overlay(tc,mg)
end
end
--サモンブレーカー
function c18114794.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(18114794,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(18114794)
e2:SetOperation(c18114794.operation)
c:RegisterEffect(e2)
if not c18114794.global_check then
c18114794.global_check=true
c18114794[0]=0
c18114794[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(c18114794.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
ge2:SetOperation(c18114794.checkop)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_SPSUMMON_SUCCESS)
ge3:SetOperation(c18114794.checkop)
Duel.RegisterEffect(ge3,0)
end
end
function c18114794.checkop(e,tp,eg,ep,ev,re,r,rp)
local turnp=Duel.GetTurnPlayer()
if Duel.GetTurnCount()~=c18114794[2] then
c18114794[0]=0
c18114794[1]=0
c18114794[2]=Duel.GetTurnCount()
end
local tc=eg:GetFirst()
while tc do
local sp=tc:GetSummonPlayer()
c18114794[sp]=c18114794[sp]+1
if c18114794[sp]==3 and sp==turnp then
Duel.RaiseEvent(e:GetHandler(),18114794,e,0,0,0,0)
end
tc=eg:GetNext()
end
end
function c18114794.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local turnp=Duel.GetTurnPlayer()
Duel.SkipPhase(turnp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(turnp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(turnp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,turnp)
end
--ビッグ・ホエール
function c18322364.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18322364,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c18322364.condition)
e1:SetCost(c18322364.cost)
e1:SetTarget(c18322364.target)
e1:SetOperation(c18322364.operation)
c:RegisterEffect(e1)
end
function c18322364.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE
end
function c18322364.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 c18322364.spfilter(c,e,tp)
return c:GetLevel()==3 and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c18322364.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(c18322364.spfilter,tp,LOCATION_DECK,0,3,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_DECK)
end
function c18322364.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<3 then return end
local g=Duel.GetMatchingGroup(c18322364.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,3,3,nil)
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2,true)
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
end
--ヒステリック・サイン
function c19337371.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c19337371.cost)
e1:SetTarget(c19337371.target)
e1:SetOperation(c19337371.activate)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c19337371.regcon)
e2:SetOperation(c19337371.regop)
c:RegisterEffect(e2)
end
function c19337371.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19337371)==0 end
Duel.RegisterFlagEffect(tp,19337371,RESET_PHASE+PHASE_END,0,1)
end
function c19337371.filter(c)
return c:IsCode(90219263) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c19337371.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19337371.filter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function c19337371.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c19337371.filter,tp,LOCATION_GRAVE+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 c19337371.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD) and Duel.GetFlagEffect(tp,19337371)==0
end
function c19337371.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(19337371,0))
e1:SetCategory(CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetTarget(c19337371.thtg)
e1:SetOperation(c19337371.thop)
Duel.RegisterEffect(e1,tp)
end
function c19337371.thfilter(c)
return c:IsSetCard(0x64) and c:IsAbleToHand()
end
function c19337371.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19337371)==0 end
Duel.RegisterFlagEffect(tp,19337371,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function c19337371.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c19337371.thfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,nil)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(19337371,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g2:GetFirst():GetCode())
g1:Merge(g2)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(19337371,1)) then
g2=g:Select(tp,1,1,nil)
g1:Merge(g2)
end
end
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
--瀑征竜-タイダル
function c26400609.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(26400609,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCost(c26400609.hspcost)
e1:SetTarget(c26400609.hsptg)
e1:SetOperation(c26400609.hspop)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(26400609,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(c26400609.retcon)
e2:SetTarget(c26400609.rettg)
e2:SetOperation(c26400609.retop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(26400609,2))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetCost(c26400609.tgcost)
e3:SetTarget(c26400609.tgtg)
e3:SetOperation(c26400609.tgop)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(26400609,3))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_REMOVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CHAIN_UNIQUE)
e4:SetCost(c26400609.thcost)
e4:SetTarget(c26400609.thtg)
e4:SetOperation(c26400609.thop)
c:RegisterEffect(e4)
end
function c26400609.rfilter(c)
return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WATER)) and c:IsAbleToRemoveAsCost()
end
function c26400609.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,26400609)==0
and Duel.IsExistingMatchingCard(c26400609.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c26400609.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,26400609,RESET_PHASE+PHASE_END,0,1)
end
function c26400609.hsptg(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 c26400609.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c26400609.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c26400609.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c26400609.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c26400609.dfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable()
end
function c26400609.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,26400609)==0 and e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c26400609.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c26400609.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,26400609,RESET_PHASE+PHASE_END,0,1)
end
function c26400609.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c26400609.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26400609.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c26400609.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c26400609.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c26400609.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,26400609)==0 end
Duel.RegisterFlagEffect(tp,26400609,RESET_PHASE+PHASE_END,0,1)
end
function c26400609.thfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
end
function c26400609.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26400609.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c26400609.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c26400609.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 c32542011.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c32542011.condition)
e1:SetTarget(c32542011.target)
e1:SetOperation(c32542011.activate)
c:RegisterEffect(e1)
end
function c32542011.cfilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsAttribute(ATTRIBUTE_WATER+ATTRIBUTE_FIRE)
end
function c32542011.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c32542011.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c32542011.cfilter2(c,att)
return c:IsFaceup() and c:IsAttribute(att)
end
function c32542011.spfilter(c,tid,e,tp)
local re=c:GetReasonEffect()
return c:GetTurnID()==tid and c:IsReason(REASON_COST) and re and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER)
and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c32542011.desfilter(c)
return c:IsDestructable()
end
function c32542011.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return
(Duel.IsExistingMatchingCard(c32542011.cfilter2,tp,LOCATION_MZONE,0,1,nil,ATTRIBUTE_FIRE)
and Duel.IsExistingMatchingCard(c32542011.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))
or
(Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c32542011.cfilter2,tp,LOCATION_MZONE,0,1,nil,ATTRIBUTE_WATER)
and Duel.IsExistingMatchingCard(c32542011.spfilter,tp,LOCATION_GRAVE,0,1,nil,Duel.GetTurnCount(),e,tp))
end
if Duel.IsExistingMatchingCard(c32542011.cfilter2,tp,LOCATION_MZONE,0,1,nil,ATTRIBUTE_FIRE) then
local g=Duel.GetMatchingGroup(c32542011.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
if Duel.IsExistingMatchingCard(c32542011.cfilter2,tp,LOCATION_MZONE,0,1,nil,ATTRIBUTE_WATER) then
local g=Duel.GetMatchingGroup(c32542011.spfilter,tp,LOCATION_GRAVE,0,nil,Duel.GetTurnCount(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,Duel.GetLocationCount(tp,LOCATION_MZONE),0,0)
end
end
function c32542011.activate(e,tp,eg,ep,ev,re,r,rp)
local opt=0
if Duel.IsExistingMatchingCard(c32542011.cfilter2,tp,LOCATION_MZONE,0,1,nil,ATTRIBUTE_WATER) then opt=opt+1 end
if Duel.IsExistingMatchingCard(c32542011.cfilter2,tp,LOCATION_MZONE,0,1,nil,ATTRIBUTE_FIRE) then opt=opt+2 end
if opt==1 or opt==3 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c32542011.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,Duel.GetTurnCount(),e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,c32542011.desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
if opt==2 or opt==3 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c32542011.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
--エクシーズ・ブロック
function c44487250.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:SetCondition(c44487250.condition)
e1:SetCost(c44487250.cost)
e1:SetTarget(c44487250.target)
e1:SetOperation(c44487250.activate)
c:RegisterEffect(e1)
end
function c44487250.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c44487250.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
function c44487250.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 c44487250.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--ピンポイント・ガード
function c44509898.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_ATTACK_ANNOUNCE)
e1:SetCondition(c44509898.condition)
e1:SetTarget(c44509898.target)
e1:SetOperation(c44509898.operation)
c:RegisterEffect(e1)
end
function c44509898.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c44509898.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c44509898.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c44509898.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c44509898.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c44509898.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c44509898.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
end
end
--七星の宝刀
function c45725480.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c45725480.cost)
e1:SetTarget(c45725480.target)
e1:SetOperation(c45725480.activate)
c:RegisterEffect(e1)
end
function c45725480.filter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:GetLevel()==7 and c:IsAbleToRemoveAsCost()
end
function c45725480.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,45725480)==0
and Duel.IsExistingMatchingCard(c45725480.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c45725480.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,45725480,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c45725480.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 c45725480.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--魔導書の神判
function c46448938.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c46448938.cost)
e1:SetOperation(c46448938.activate)
c:RegisterEffect(e1)
end
function c46448938.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,46448938)==0 end
Duel.RegisterFlagEffect(tp,46448938,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c46448938.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c46448938.regcon)
e1:SetOperation(c46448938.regop1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetCondition(c46448938.regcon)
e2:SetOperation(c46448938.regop2)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(46448938,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetTarget(c46448938.efftg)
e3:SetOperation(c46448938.effop)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
e1:SetLabelObject(e3)
e2:SetLabelObject(e3)
end
function c46448938.regcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL)
end
function c46448938.regop1(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(ct+1)
end
function c46448938.regop2(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel()
if ct==0 then ct=1 end
e:GetLabelObject():SetLabel(ct-1)
end
function c46448938.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabel()>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c46448938.sfilter(c)
return c:IsSetCard(0x106e) and c:GetCode()~=46448938 and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c46448938.spfilter(c,lv,e,tp)
return c:IsLevelBelow(lv) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c46448938.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c46448938.sfilter,tp,LOCATION_DECK,0,1,e:GetLabel(),nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c46448938.spfilter,tp,LOCATION_DECK,0,1,nil,g:GetCount(),e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(46448938,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c46448938.spfilter,tp,LOCATION_DECK,0,1,1,nil,g:GetCount(),e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--焔征竜-ブラスター
function c53804307.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53804307,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCost(c53804307.hspcost)
e1:SetTarget(c53804307.hsptg)
e1:SetOperation(c53804307.hspop)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53804307,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(c53804307.retcon)
e2:SetTarget(c53804307.rettg)
e2:SetOperation(c53804307.retop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(53804307,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCost(c53804307.descost)
e3:SetTarget(c53804307.destg)
e3:SetOperation(c53804307.desop)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(53804307,3))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_REMOVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CHAIN_UNIQUE)
e4:SetCost(c53804307.thcost)
e4:SetTarget(c53804307.thtg)
e4:SetOperation(c53804307.thop)
c:RegisterEffect(e4)
end
function c53804307.rfilter(c)
return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_FIRE)) and c:IsAbleToRemoveAsCost()
end
function c53804307.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,53804307)==0
and Duel.IsExistingMatchingCard(c53804307.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c53804307.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,53804307,RESET_PHASE+PHASE_END,0,1)
end
function c53804307.hsptg(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 c53804307.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c53804307.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c53804307.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c53804307.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c53804307.dfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDiscardable()
end
function c53804307.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,53804307)==0 and e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c53804307.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c53804307.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,53804307,RESET_PHASE+PHASE_END,0,1)
end
function c53804307.desfilter(c)
return c:IsDestructable()
end
function c53804307.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsOnField() and c53804307.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c53804307.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c53804307.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c53804307.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 c53804307.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,53804307)==0 end
Duel.RegisterFlagEffect(tp,53804307,RESET_PHASE+PHASE_END,0,1)
end
function c53804307.thfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToHand()
end
function c53804307.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c53804307.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c53804307.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c53804307.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 c57782164.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(c57782164.target)
e1:SetOperation(c57782164.activate)
c:RegisterEffect(e1)
end
function c57782164.filter(c,e,tp)
return c:IsSetCard(0x54) and c:GetLevel()~=4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c57782164.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c57782164.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND)
end
function c57782164.activate(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,c57782164.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end
end
--魔導獣士 ルード
function c65961085.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(65961085,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c65961085.retcon)
e1:SetCost(c65961085.retcost)
e1:SetTarget(c65961085.rettg)
e1:SetOperation(c65961085.retop)
c:RegisterEffect(e1)
end
function c65961085.retcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsRace(RACE_SPELLCASTER)
end
function c65961085.retcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,65961085)==0 end
Duel.RegisterFlagEffect(tp,65961085,RESET_PHASE+PHASE_END,0,1)
end
function c65961085.filter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function c65961085.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c65961085.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c65961085.filter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c65961085.filter,tp,LOCATION_REMOVED,0,1,99,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c65961085.filter2(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL)
end
function c65961085.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
local g2=Duel.GetMatchingGroup(c65961085.filter2,tp,LOCATION_REMOVED,0,nil)
if g2:GetCount()>0 then
Duel.SendtoGrave(g2,REASON_EFFECT+REASON_RETURN)
end
end
--激流蘇生
function c7092142.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c7092142.condition)
e1:SetCost(c7092142.cost)
e1:SetTarget(c7092142.target)
e1:SetOperation(c7092142.operation)
c:RegisterEffect(e1)
end
function c7092142.cfilter(c,tp)
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsAttribute(ATTRIBUTE_WATER)
end
function c7092142.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c7092142.cfilter,1,nil,tp)
end
function c7092142.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,7092142)==0 end
Duel.RegisterFlagEffect(tp,7092142,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c7092142.spfilter(c,e,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c7092142.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=eg:FilterCount(c7092142.spfilter,nil,e,tp)
return ct>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=ct
end
Duel.SetTargetCard(eg)
local g=eg:Filter(c7092142.spfilter,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c7092142.spfilter2(c,e,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c7092142.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local sg=eg:Filter(c7092142.spfilter2,nil,e,tp)
if ft<sg:GetCount() then return end
local ct=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.Damage(1-tp,ct*500,REASON_EFFECT)
end
--もの忘れ
function c71098407.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c71098407.condition)
e1:SetTarget(c71098407.target)
e1:SetOperation(c71098407.activate)
c:RegisterEffect(e1)
end
function c71098407.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and re:GetHandler():IsOnField() and re:GetHandler():IsFaceup()
end
function c71098407.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsCanTurnSet() end
Duel.SetTargetCard(re:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c71098407.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(e) and rc:IsFaceup() and rc:IsCanTurnSet() then
Duel.ChangePosition(rc,POS_FACEDOWN_DEFENCE)
end
end
--星邪の神喰
function c72710085.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(72710085,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CHAIN_UNIQUE)
e2:SetCode(EVENT_REMOVE)
e2:SetCondition(c72710085.tgcon)
e2:SetCost(c72710085.tgcost)
e2:SetTarget(c72710085.tgtg)
e2:SetOperation(c72710085.tgop)
c:RegisterEffect(e2)
end
function c72710085.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:GetFirst():IsPreviousLocation(LOCATION_GRAVE) and eg:GetFirst():IsControler(tp)
end
function c72710085.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,72710085)==0 end
Duel.RegisterFlagEffect(tp,72710085,RESET_PHASE+PHASE_END,0,1)
end
function c72710085.filter(c,att)
return not c:IsAttribute(att) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c72710085.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.IsExistingMatchingCard(c72710085.filter,tp,LOCATION_DECK,0,1,nil,eg:GetFirst():GetAttribute()) end
e:SetLabel(eg:GetFirst():GetAttribute())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c72710085.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c72710085.filter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel())
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--最強の盾
function c84877802.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c84877802.target)
e1:SetOperation(c84877802.operation)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c84877802.atkval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_DEFENCE)
e3:SetValue(c84877802.defval)
c:RegisterEffect(e3)
--Equip limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EQUIP_LIMIT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(c84877802.equiplimit)
c:RegisterEffect(e4)
end
function c84877802.equiplimit(e,c)
return c:IsRace(RACE_WARRIOR)
end
function c84877802.filter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
function c84877802.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c84877802.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c84877802.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c84877802.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c84877802.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c84877802.atkval(e,c)
if c:IsDefencePos() then return 0 else return c:GetBaseDefence() end
end
function c84877802.defval(e,c)
if c:IsAttackPos() then return 0 else return c:GetBaseAttack() end
end
--No.107 銀河眼の時空竜
function c88177324.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,8),2)
c:EnableReviveLimit()
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88177324,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(TIMING_BATTLE_START,0)
e1:SetCondition(c88177324.negcon)
e1:SetCost(c88177324.negcost)
e1:SetTarget(c88177324.negtg)
e1:SetOperation(c88177324.negop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetCondition(c88177324.regcon)
e2:SetOperation(c88177324.regop)
c:RegisterEffect(e2)
end
function c88177324.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_BATTLE and not Duel.CheckPhaseActivity() and Duel.GetCurrentChain()==0
end
function c88177324.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c88177324.filter1(c)
return c:IsType(TYPE_EFFECT)
end
function c88177324.filter2(c)
return c:GetAttack()~=c:GetBaseAttack() or c:GetDefence()~=c:GetBaseDefence()
end
function c88177324.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return
Duel.IsExistingMatchingCard(c88177324.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
or Duel.IsExistingMatchingCard(c88177324.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
end
end
function c88177324.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c88177324.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,c)
local tc=g:GetFirst()
while tc do
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)
tc=g:GetNext()
end
g=Duel.GetMatchingGroup(c88177324.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,c)
tc=g:GetFirst()
while tc do
if tc:GetAttack()~=tc:GetBaseAttack() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetBaseAttack())
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
if tc:GetDefence()~=tc:GetBaseDefence() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENCE_FINAL)
e1:SetValue(tc:GetBaseDefence())
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
tc=g:GetNext()
end
if c:IsFaceup() and c:IsRelateToEffect(e) then
c:RegisterFlagEffect(88177324,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE,0,1)
end
end
function c88177324.regcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetFlagEffect(88177324)>0
end
function c88177324.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
end
--嵐征竜-テンペスト
function c89399912.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(89399912,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCost(c89399912.hspcost)
e1:SetTarget(c89399912.hsptg)
e1:SetOperation(c89399912.hspop)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(89399912,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(c89399912.retcon)
e2:SetTarget(c89399912.rettg)
e2:SetOperation(c89399912.retop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(89399912,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetCost(c89399912.shcost)
e3:SetTarget(c89399912.shtg)
e3:SetOperation(c89399912.shop)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(89399912,3))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_REMOVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CHAIN_UNIQUE)
e4:SetCost(c89399912.thcost)
e4:SetTarget(c89399912.thtg)
e4:SetOperation(c89399912.thop)
c:RegisterEffect(e4)
end
function c89399912.rfilter(c)
return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_WIND)) and c:IsAbleToRemoveAsCost()
end
function c89399912.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,89399912)==0
and Duel.IsExistingMatchingCard(c89399912.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c89399912.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,89399912,RESET_PHASE+PHASE_END,0,1)
end
function c89399912.hsptg(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 c89399912.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c89399912.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c89399912.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c89399912.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c89399912.dfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsDiscardable()
end
function c89399912.shcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,89399912)==0 and e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c89399912.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c89399912.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,89399912,RESET_PHASE+PHASE_END,0,1)
end
function c89399912.shfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToHand()
end
function c89399912.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c89399912.shfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c89399912.shop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c89399912.shfilter,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 c89399912.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,89399912)==0 end
Duel.RegisterFlagEffect(tp,89399912,RESET_PHASE+PHASE_END,0,1)
end
function c89399912.thfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToHand()
end
function c89399912.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c89399912.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c89399912.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c89399912.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 c90411554.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(90411554,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCost(c90411554.hspcost)
e1:SetTarget(c90411554.hsptg)
e1:SetOperation(c90411554.hspop)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(90411554,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(c90411554.retcon)
e2:SetTarget(c90411554.rettg)
e2:SetOperation(c90411554.retop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(90411554,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCost(c90411554.spcost)
e3:SetTarget(c90411554.sptg)
e3:SetOperation(c90411554.spop)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(90411554,3))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_REMOVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CHAIN_UNIQUE)
e4:SetCost(c90411554.thcost)
e4:SetTarget(c90411554.thtg)
e4:SetOperation(c90411554.thop)
c:RegisterEffect(e4)
end
function c90411554.rfilter(c)
return (c:IsRace(RACE_DRAGON) or c:IsAttribute(ATTRIBUTE_EARTH)) and c:IsAbleToRemoveAsCost()
end
function c90411554.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,90411554)==0
and Duel.IsExistingMatchingCard(c90411554.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c90411554.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,90411554,RESET_PHASE+PHASE_END,0,1)
end
function c90411554.hsptg(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 c90411554.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c90411554.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c90411554.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c90411554.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c90411554.dfilter(c)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsDiscardable()
end
function c90411554.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,90411554)==0 and e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c90411554.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c90411554.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,90411554,RESET_PHASE+PHASE_END,0,1)
end
function c90411554.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c90411554.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCAITON_GRAVE) and c90411554.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c90411554.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c90411554.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c90411554.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 c90411554.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,90411554)==0 end
Duel.RegisterFlagEffect(tp,90411554,RESET_PHASE+PHASE_END,0,1)
end
function c90411554.thfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand()
end
function c90411554.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c90411554.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c90411554.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c90411554.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
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