Commit fc3e6c7f authored by VanillaSalt's avatar VanillaSalt

new

parent 5e7ea0fe
--暗遷士 カンゴルゴーム
function c21501505.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,4),2)
c:EnableReviveLimit()
--replace
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21501505,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c21501505.condition)
e1:SetCost(c21501505.cost)
e1:SetTarget(c21501505.target)
e1:SetOperation(c21501505.operation)
c:RegisterEffect(e1)
end
function c21501505.condition(e,tp,eg,ep,ev,re,r,rp)
if e==re or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()~=1 then return false end
local tc=g:GetFirst()
e:SetLabelObject(tc)
return tc:IsOnField()
end
function c21501505.cost(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 c21501505.filter(c,re,rp,tf,ceg,cep,cev,cre,cr,crp)
return tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c)
end
function c21501505.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tf=re:GetTarget()
local res,ceg,cep,cev,cre,cr,crp=Duel.CheckEvent(re:GetCode(),true)
if chkc then return chkc:IsOnField() and c21501505.filter(chkc,re,rp,tf,ceg,cep,cev,cre,cr,crp) end
if chk==0 then return Duel.IsExistingTarget(c21501505.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetLabelObject(),re,rp,tf,ceg,cep,cev,cre,cr,crp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c21501505.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetLabelObject(),re,rp,tf,ceg,cep,cev,cre,cr,crp)
end
function c21501505.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.ChangeTargetCard(ev,Group.FromCards(tc))
end
end
--ゲイザー・シャーク
function c23536866.initial_effect(c)
--xyz
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23536866,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c23536866.cost)
e1:SetTarget(c23536866.target)
e1:SetOperation(c23536866.operation)
c:RegisterEffect(e1)
end
function c23536866.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23536866)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,23536866,RESET_PHASE+PHASE_END,0,1)
end
function c23536866.filter(c,e,tp)
return c:GetLevel()==5 and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(23536866)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23536866.xyzfilter(c,mg)
if c.xyz_count~=2 then return false end
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsXyzSummonable(mg)
end
function c23536866.mfilter1(c,exg)
return exg:IsExists(c23536866.mfilter2,1,nil,c)
end
function c23536866.mfilter2(c,mc)
return c.xyz_filter(mc)
end
function c23536866.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c23536866.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return (not Duel.IsPlayerAffectedByEffect(tp,23516703) or c23516703[tp]==0)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and mg:GetCount()>1
and Duel.IsExistingMatchingCard(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end
local exg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=mg:FilterSelect(tp,c23536866.mfilter1,1,1,nil,exg)
local tc1=sg1:GetFirst()
local exg2=exg:Filter(c23536866.mfilter2,nil,tc1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=mg:FilterSelect(tp,c23536866.mfilter1,1,1,tc1,exg2)
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,2,0,0)
end
function c23536866.filter2(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23536866.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,23516703) and c23516703[tp]>0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c23536866.filter2,nil,e,tp)
if g:GetCount()<2 then return end
local tc1=g:GetFirst()
local tc2=g:GetNext()
Duel.SpecialSummonStep(tc1,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(tc2,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)
tc1:RegisterEffect(e1)
local e2=e1:Clone()
tc1:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc2:RegisterEffect(e3)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
Duel.BreakEffect()
local xyzg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,g)
end
end
--銀河暴竜
function c24658418.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24658418,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c24658418.condition)
e1:SetTarget(c24658418.target)
e1:SetOperation(c24658418.operation)
c:RegisterEffect(e1)
--xyz
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(24658418,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c24658418.spcon)
e2:SetTarget(c24658418.sptg)
e2:SetOperation(c24658418.spop)
c:RegisterEffect(e2)
end
function c24658418.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
return at:IsControler(tp) and at:IsSetCard(0x7b)
end
function c24658418.target(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 c24658418.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),1,tp,tp,false,false,POS_FACEUP)
end
end
function c24658418.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c24658418.mfilter(c)
return c:IsSetCard(0x7b) and not c:IsType(TYPE_TOKEN)
end
function c24658418.xyzfilter(c,mg)
return c:IsSetCard(0x7b) and c:IsXyzSummonable(mg)
end
function c24658418.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c24658418.mfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(c24658418.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,g)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c24658418.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c24658418.mfilter,tp,LOCATION_MZONE,0,nil)
local xyzg=Duel.GetMatchingGroup(c24658418.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:FilterSelect(tp,xyz.xyz_filter,xyz.xyz_count,xyz.xyz_count,nil)
Duel.XyzSummon(tp,xyz,sg)
end
end
--スクラップ・ファクトリー
function c28388296.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:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x24))
e2:SetValue(200)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENCE)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(28388296,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c28388296.condition)
e4:SetCost(c28388296.cost)
e4:SetTarget(c28388296.target)
e4:SetOperation(c28388296.operation)
c:RegisterEffect(e4)
end
function c28388296.cfilter(c,tp)
return c:IsSetCard(0x24) and c:IsType(TYPE_MONSTER) and bit.band(c:GetReason(),0x41)==0x41
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function c28388296.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c28388296.cfilter,1,nil,tp)
end
function c28388296.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,28388296)==0 end
Duel.RegisterFlagEffect(tp,28388296,RESET_PHASE+PHASE_END,0,1)
end
function c28388296.spfilter(c,e,tp)
return c:IsSetCard(0x24) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c28388296.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c28388296.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c28388296.operation(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,c28388296.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ゴーストリック・パレード
function c29400787.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c29400787.cfilter)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29400787,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c29400787.thcon)
e3:SetTarget(c29400787.thtg)
e3:SetOperation(c29400787.thop)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(0,1)
e4:SetValue(0)
c:RegisterEffect(e4)
end
function c29400787.cfilter(e,c)
return c:IsFacedown()
end
function c29400787.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()~=nil
end
function c29400787.filter(c)
return c:IsSetCard(0x8d) and c:IsAbleToHand()
end
function c29400787.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29400787.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c29400787.thop(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,c29400787.filter,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 c34680482.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34680482,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c34680482.retcon)
e1:SetTarget(c34680482.rettg)
e1:SetOperation(c34680482.retop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(34680482,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c34680482.spcost)
e2:SetTarget(c34680482.sptg)
e2:SetOperation(c34680482.spop)
c:RegisterEffect(e2)
end
function c34680482.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()~=tp
and e:GetHandler():GetPreviousControler()==tp
end
function c34680482.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c34680482.retop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)
end
end
function c34680482.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,34680482)==0 and e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
Duel.RegisterFlagEffect(tp,34680482,RESET_PHASE+PHASE_END,0,1)
end
function c34680482.filter(c,e,tp)
return c:IsSetCard(0x71) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c34680482.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c34680482.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c34680482.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,c34680482.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
local c=e:GetHandler()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(34680482,RESET_EVENT+0x1fe0000,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetLabel(Duel.GetTurnCount())
e2:SetLabelObject(tc)
e2:SetCondition(c34680482.tdcon)
e2:SetOperation(c34680482.tdop)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
e2:SetCountLimit(1)
Duel.RegisterEffect(e2,tp)
end
end
function c34680482.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()==tp
end
function c34680482.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(34680482)>0 then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
--暗黒界の鬼神 ケルト
function c34968834.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34968834,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c34968834.spcon)
e1:SetTarget(c34968834.sptg)
e1:SetOperation(c34968834.spop)
c:RegisterEffect(e1)
end
function c34968834.spcon(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(e:GetHandler():GetPreviousControler())
return e:GetHandler():IsPreviousLocation(LOCATION_HAND) and bit.band(r,0x4040)==0x4040
end
function c34968834.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c34968834.filter(c,e,tp)
return c:IsRace(RACE_FIEND)
and ((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
or (Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)))
end
function c34968834.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)==0 then return end
if rp~=tp and tp==e:GetLabel() and Duel.IsExistingMatchingCard(c34968834.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(34968834,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c34968834.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(34968834,2),aux.Stringid(34968834,3))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(34968834,2))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(34968834,3))+1
else return end
if op==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP)
end
end
end
end
--ティオの蟲惑魔
function c45803070.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c45803070.efilter)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(45803070,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c45803070.sptg)
e2:SetOperation(c45803070.spop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(45803070,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCost(c45803070.setcost)
e3:SetTarget(c45803070.settg)
e3:SetOperation(c45803070.setop)
c:RegisterEffect(e3)
end
function c45803070.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and (c:IsSetCard(0x4c) or c:IsSetCard(0x89))
end
function c45803070.filter(c,e,tp)
return c:IsSetCard(0x108a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c45803070.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c45803070.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c45803070.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c45803070.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c45803070.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_DEFENCE)
end
end
function c45803070.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,45803070)==0 end
Duel.RegisterFlagEffect(tp,45803070,RESET_PHASE+PHASE_END,0,1)
end
function c45803070.setfilter(c)
return c:GetType()==TYPE_TRAP and (c:IsSetCard(0x4c) or c:IsSetCard(0x89)) and c:IsSSetable()
end
function c45803070.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c45803070.setfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c45803070.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c45803070.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c45803070.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
if Duel.GetTurnPlayer()==tp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetLabel(0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN)
end
e1:SetLabelObject(tc)
e1:SetCondition(c45803070.rmcon)
e1:SetOperation(c45803070.rmop)
Duel.RegisterEffect(e1,tp)
tc:CreateEffectRelation(e1)
end
end
function c45803070.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()==tp
end
function c45803070.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--ブリザード・サンダーバード
function c50920465.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50920465,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c50920465.cost)
e1:SetTarget(c50920465.target)
e1:SetOperation(c50920465.operation)
c:RegisterEffect(e1)
end
function c50920465.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,50920465)==0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil)
Duel.RegisterFlagEffect(tp,50920465,RESET_PHASE+PHASE_END,0,1)
end
function c50920465.filter(c,e,tp)
return c:IsRace(RACE_WINDBEAST) and c:IsAttribute(ATTRIBUTE_WATER)
and not c:IsCode(50920465) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c50920465.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(c50920465.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c50920465.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c50920465.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g1=Duel.GetMatchingGroup(c50920465.filter,tp,LOCATION_HAND,0,nil,e,tp)
local g2=Duel.GetMatchingGroup(c50920465.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g2:Select(tp,1,1,nil)
sg1:Merge(sg2)
Duel.SpecialSummon(sg1,0,tp,tp,false,false,POS_FACEUP)
if e:GetHandler():IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
--防覇龍ヘリオスフィア
function c51043053.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetCondition(c51043053.atcon)
c:RegisterEffect(e1)
--lv change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(51043053,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c51043053.condition)
e2:SetOperation(c51043053.operation)
c:RegisterEffect(e2)
end
function c51043053.atcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)==1
and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),0,LOCATION_HAND)<5
end
function c51043053.filter(c)
return c:IsFaceup() and c:GetLevel()==8 and c:IsRace(RACE_DRAGON)
end
function c51043053.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLevel()~=8
and Duel.IsExistingMatchingCard(c51043053.filter,tp,LOCATION_MZONE,0,1,nil)
end
function c51043053.operation(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_CHANGE_LEVEL)
e1:SetValue(8)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
c:RegisterEffect(e1)
end
end
--禁じられた聖典
function c54773234.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetOperation(c54773234.activate)
c:RegisterEffect(e1)
end
function c54773234.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(c54773234.distg)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c54773234.disop)
e2:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e3,tp)
if a:IsRelateToBattle() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetReset(RESET_PHASE+PHASE_DAMAGE)
e4:SetValue(a:GetBaseAttack())
a:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SET_DEFENCE_FINAL)
e5:SetReset(RESET_PHASE+PHASE_DAMAGE)
e5:SetValue(a:GetBaseDefence())
a:RegisterEffect(e5)
end
if d and d:IsRelateToBattle() then
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_SET_ATTACK_FINAL)
e6:SetValue(d:GetBaseAttack())
e6:SetReset(RESET_PHASE+PHASE_DAMAGE)
d:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_SET_DEFENCE_FINAL)
e7:SetValue(d:GetBaseDefence())
e7:SetReset(RESET_PHASE+PHASE_DAMAGE)
d:RegisterEffect(e7)
end
end
function c54773234.distg(e,c)
return c~=e:GetHandler()
end
function c54773234.disop(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
if bit.band(loc,LOCATION_ONFIELD)~=0 then
Duel.NegateEffect(ev)
end
end
--古代の機械箱
function c60953949.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60953949,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_TO_HAND)
e1:SetCondition(c60953949.thcon)
e1:SetCost(c60953949.thcost)
e1:SetTarget(c60953949.thtg)
e1:SetOperation(c60953949.thop)
c:RegisterEffect(e1)
end
function c60953949.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
and e:GetHandler():IsPreviousLocation(LOCATION_DECK+LOCATION_GRAVE)
end
function c60953949.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,60953949)==0 end
Duel.RegisterFlagEffect(tp,60953949,RESET_PHASE+PHASE_END,0,1)
end
function c60953949.filter(c)
return (c:GetAttack()==500 or c:GetDefence()==500) and c:GetCode()~=60953949
and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand()
end
function c60953949.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60953949.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c60953949.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60953949.filter,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 c68618157.initial_effect(c)
c:SetUniqueOnField(1,0,68618157)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,4),3)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68618157,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c68618157.spcon)
e1:SetCost(c68618157.cost)
e1:SetTarget(c68618157.sptg)
e1:SetOperation(c68618157.spop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(68618157,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c68618157.thcon)
e2:SetCost(c68618157.cost)
e2:SetTarget(c68618157.thtg)
e2:SetOperation(c68618157.thop)
c:RegisterEffect(e2)
end
function c68618157.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c68618157.cost(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 c68618157.spfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c68618157.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c68618157.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c68618157.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c68618157.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c68618157.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 c68618157.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c68618157.thfilter(c)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsAbleToHand()
end
function c68618157.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c68618157.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c68618157.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c68618157.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c68618157.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--ガスタの神裔 ピリカ
function c71175527.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71175527,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCost(c71175527.spcost)
e1:SetTarget(c71175527.sptg)
e1:SetOperation(c71175527.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c71175527.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,71175527)==0 end
Duel.RegisterFlagEffect(tp,71175527,RESET_PHASE+PHASE_END,0,1)
end
function c71175527.filter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71175527.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c71175527.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c71175527.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c71175527.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c71175527.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE) 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)
end
Duel.SpecialSummonComplete()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c71175527.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c71175527.splimit(e,c,tp,sumtp,sumpos)
return not c:IsAttribute(ATTRIBUTE_WIND)
end
--幻獣機オライオン
function c72291078.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(c72291078.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(72291078,0))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c72291078.cost)
e3:SetTarget(c72291078.target)
e3:SetOperation(c72291078.operation)
c:RegisterEffect(e3)
--token
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(72291078,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CHAIN_UNIQUE)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c72291078.spcon)
e4:SetCost(c72291078.spcost)
e4:SetTarget(c72291078.sptg)
e4:SetOperation(c72291078.spop)
c:RegisterEffect(e4)
end
function c72291078.indcon(e)
return Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,TYPE_TOKEN)
end
function c72291078.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c72291078.filter(c)
return c:IsSetCard(0x101b) and c:IsSummonable(true,nil)
end
function c72291078.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c72291078.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c72291078.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c72291078.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function c72291078.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c72291078.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,72291078)==0 end
Duel.RegisterFlagEffect(tp,72291078,RESET_PHASE+PHASE_END,0,1)
end
function c72291078.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,0x4011,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c72291078.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,0x4011,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND) then
local token=Duel.CreateToken(tp,72291079)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
--剣闘獣アウグストル
function c7573135.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7573135,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c7573135.hspcon)
e1:SetTarget(c7573135.hsptg)
e1:SetOperation(c7573135.hspop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(7573135,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c7573135.spcon)
e2:SetCost(c7573135.spcost)
e2:SetTarget(c7573135.sptg)
e2:SetOperation(c7573135.spop)
c:RegisterEffect(e2)
end
function c7573135.hspcon(e,tp,eg,ep,ev,re,r,rp)
local st=e:GetHandler():GetSummonType()
return st>=(SUMMON_TYPE_SPECIAL+100) and st<(SUMMON_TYPE_SPECIAL+150)
end
function c7573135.hspfilter(c,e,tp)
return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,113,tp,false,false)
end
function c7573135.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c7573135.hspfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c7573135.hspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c7573135.hspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,113,tp,tp,false,false,POS_FACEUP_DEFENCE)
tc:RegisterFlagEffect(7573135,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:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(c7573135.retop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c7573135.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(7573135)>0 then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
function c7573135.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0
end
function c7573135.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c,nil,2,REASON_COST)
end
function c7573135.filter(c,e,tp)
return c:IsSetCard(0x19) and not c:IsCode(7573135) and c:IsCanBeSpecialSummoned(e,113,tp,false,false)
end
function c7573135.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c7573135.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c7573135.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,c7573135.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,113,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
end
end
--コアキメイルの金剛核
function c81994591.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c81994591.target)
e1:SetOperation(c81994591.activate)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(81994591,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c81994591.indcost)
e2:SetTarget(c81994591.indtg)
e2:SetOperation(c81994591.indop)
c:RegisterEffect(e2)
end
function c81994591.filter(c)
return c:IsSetCard(0x1d) and c:GetCode()~=81994591 and c:IsAbleToHand()
end
function c81994591.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c81994591.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c81994591.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c81994591.filter,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 c81994591.indcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c81994591.indfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1d)
end
function c81994591.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c81994591.indfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c81994591.indop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x1d))
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
--ゴーストリック・ナイト
function c85827713.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cannot remove
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetCondition(c85827713.sumcon)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(85827713,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c85827713.limcon)
e3:SetOperation(c85827713.limop)
c:RegisterEffect(e3)
end
function c85827713.sfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8d)
end
function c85827713.sumcon(e)
return Duel.IsExistingMatchingCard(c85827713.sfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c85827713.limcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
function c85827713.limop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--ラスト・カウンター
function c86049351.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c86049351.condition)
e1:SetTarget(c86049351.target)
e1:SetOperation(c86049351.activate)
c:RegisterEffect(e1)
end
function c86049351.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
if not tc:IsControler(tp) then tc=at end
e:SetLabelObject(tc)
return at and tc:IsControler(tp) and tc:IsLocation(LOCATION_MZONE) and tc:IsSetCard(0x84)
end
function c86049351.filter(c)
return c:IsFaceup() and c:IsSetCard(0x84)
end
function c86049351.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c86049351.filter,tp,LOCATION_MZONE,0,1,e:GetLabelObject()) end
end
function c86049351.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local bc=tc:GetBattleTarget()
if Duel.NegateAttack() and tc:IsRelateToBattle() and bc:IsRelateToBattle() then
Duel.SendtoGrave(tc,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectMatchingCard(tp,c86049351.filter,tp,LOCATION_MZONE,0,1,1,nil)
local sc=g:GetFirst()
local atk=bc:GetBaseAttack()
if atk<0 then atk=0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e1)
Duel.CalculateDamage(bc,sc)
Duel.BreakEffect()
Duel.Damage(tp,atk,REASON_EFFECT)
end
end
--陽炎獣 ヒュドラー
function c8696773.initial_effect(c)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c8696773.tgvalue)
c:RegisterEffect(e1)
--sum limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(c8696773.splimit)
c:RegisterEffect(e2)
--effect gain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(c8696773.effcon)
e3:SetOperation(c8696773.effop)
c:RegisterEffect(e3)
end
function c8696773.tgvalue(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
function c8696773.splimit(e,c,tp,sumtp,sumpos)
return not c:IsAttribute(ATTRIBUTE_FIRE)
end
function c8696773.effcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end
function c8696773.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(8696773,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c8696773.matcon)
e1:SetTarget(c8696773.mattg)
e1:SetOperation(c8696773.matop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_TYPE)
e2:SetValue(TYPE_MONSTER+TYPE_EFFECT+TYPE_XYZ)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2)
end
end
function c8696773.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ
end
function c8696773.matfilter(c)
return c:IsSetCard(0x107d) and c:IsType(TYPE_MONSTER)
end
function c8696773.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c8696773.matfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c8696773.matfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectTarget(tp,c8696773.matfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c8696773.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) then
Duel.Overlay(c,Group.FromCards(tc))
end
end
--武神-ヒルメ
function c9418365.initial_effect(c)
c:SetUniqueOnField(1,0,9418365)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9418365,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetValue(1)
e1:SetCondition(c9418365.spcon)
e1:SetOperation(c9418365.spop)
c:RegisterEffect(e1)
--discard
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9418365,1))
e2:SetCategory(CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c9418365.hdcon)
e2:SetTarget(c9418365.hdtg)
e2:SetOperation(c9418365.hdop)
c:RegisterEffect(e2)
end
function c9418365.spfilter(c)
return c:IsSetCard(0x88) and c:IsType(TYPE_MONSTER) and not c:IsCode(9418365) and c:IsAbleToRemoveAsCost()
end
function c9418365.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c9418365.spfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function c9418365.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c9418365.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c9418365.hdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetSummonType()==SUMMON_TYPE_SPECIAL+1 and rp~=tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c9418365.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0
and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,PLAYER_ALL,1)
end
function c9418365.hdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.BreakEffect()
Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
--リバース・ブレイカー
function c94950218.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(c94950218.target)
e1:SetOperation(c94950218.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(94950218,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c94950218.descon)
e2:SetTarget(c94950218.destg)
e2:SetOperation(c94950218.desop)
c:RegisterEffect(e2)
--equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c94950218.eqlimit)
c:RegisterEffect(e3)
end
function c94950218.eqlimit(e,c)
return c:IsSetCard(0x7f)
end
function c94950218.filter(c)
return c:IsFaceup() and c:IsSetCard(0x7f)
end
function c94950218.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c94950218.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c94950218.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c94950218.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c94950218.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) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function c94950218.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler():GetEquipTarget()
end
function c94950218.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c94950218.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c94950218.desfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c94950218.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetChainLimit(c94950218.climit)
end
function c94950218.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c94950218.climit(e,lp,tp)
return lp==tp or not e:IsHasType(EFFECT_TYPE_ACTIVATE)
end
--幻子力空母エンタープラズニル
function c95113856.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,9),2)
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95113856,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c95113856.cost)
e1:SetTarget(c95113856.target)
e1:SetOperation(c95113856.operation)
c:RegisterEffect(e1)
end
function c95113856.cost(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 c95113856.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,1,nil) end
local off=1
local ops={}
local opval={}
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) then
ops[off]=aux.Stringid(95113856,1)
opval[off-1]=1
off=off+1
end
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) then
ops[off]=aux.Stringid(95113856,2)
opval[off-1]=2
off=off+1
end
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) then
ops[off]=aux.Stringid(95113856,3)
opval[off-1]=3
off=off+1
end
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_DECK,1,nil) then
ops[off]=aux.Stringid(95113856,4)
opval[off-1]=4
off=off+1
end
if off==1 then return end
local op=Duel.SelectOption(tp,table.unpack(ops))
e:SetLabel(opval[op])
end
function c95113856.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
elseif op==2 then
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 then
local sg=g:RandomSelect(tp,1)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
elseif op==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
elseif op==4 then
local g=Duel.GetDecktopGroup(1-tp,1)
if g:GetCount()>0 then
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
--銀河魔鏡士
function c98263709.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98263709,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTarget(c98263709.rectg)
e1:SetOperation(c98263709.recop)
c:RegisterEffect(e1)
--spsummon
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(c98263709.flipop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(98263709,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCondition(c98263709.spcon)
e3:SetTarget(c98263709.sptg)
e3:SetOperation(c98263709.spop)
c:RegisterEffect(e3)
end
function c98263709.filter(c)
return c:IsSetCard(0x7b) and c:IsType(TYPE_MONSTER)
end
function c98263709.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local val=Duel.GetMatchingGroupCount(c98263709.filter,tp,LOCATION_GRAVE,0,nil)*500
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(val)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,val)
end
function c98263709.recop(e,tp,eg,ep,ev,re,r,rp)
local val=Duel.GetMatchingGroupCount(c98263709.filter,tp,LOCATION_GRAVE,0,nil)*500
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Recover(p,val,REASON_EFFECT)
end
function c98263709.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(98263709,RESET_EVENT+0x57a0000,0,0)
end
function c98263709.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(98263709)~=0 and e:GetHandler():IsReason(REASON_DESTROY)
end
function c98263709.spfilter(c,e,tp)
return c:IsSetCard(0x7b) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN)
and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c98263709.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c98263709.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c98263709.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,c98263709.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENCE) then
local e1=Effect.CreateEffect(e:GetHandler())
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)
tc:RegisterEffect(e1,true)
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