Commit de05cd42 authored by wind2009's avatar wind2009

remove updated cards

parent 9b9197b8
Pipeline #26078 passed with stages
in 1 minute and 7 seconds
No preview for this file type
--呪炎王バースト・カースド
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(s.atkcon)
e3:SetTarget(s.atktg2)
e3:SetOperation(s.atkop2)
c:RegisterEffect(e3)
end
function s.cfilter(c)
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_TUNER) and c:IsFaceup()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function s.atktg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function s.atkop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--インフェルニティ・クィーン
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 and Duel.IsAbleToEnterBP()
end
function s.cfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:GetEffectCount(EFFECT_DIRECT_ATTACK)==0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--爆撃獸ファイヤ・ボンバー
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),aux.FilterBoolFunction(Card.IsRace,RACE_PYRO),true)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.destg2)
e2:SetOperation(s.desop2)
c:RegisterEffect(e2)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsAttackBelow,Card.IsFaceup),tp,0,LOCATION_MZONE,1,nil,1900) end
local sg=Duel.GetMatchingGroup(aux.AND(Card.IsAttackBelow,Card.IsFaceup),tp,0,LOCATION_MZONE,nil,1900)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.AND(Card.IsAttackBelow,Card.IsFaceup),tp,0,LOCATION_MZONE,nil,1900)
Duel.Destroy(sg,REASON_EFFECT)
end
function s.destg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc:IsAttackBelow(1900) end
if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsAttackBelow,Card.IsFaceup),tp,0,LOCATION_MZONE,1,nil,1900) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.AND(Card.IsAttackBelow,Card.IsFaceup),tp,0,LOCATION_MZONE,1,1,nil,1900)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if math.max(0,sg:GetFirst():GetTextAttack())>0 then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
end
function s.desop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local atk=tc:GetTextAttack()
if atk>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
\ No newline at end of file
--魔法卡「灵魂交错」
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.sumtg)
e1:SetOperation(s.sumop)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(s.sumcon2)
e2:SetTarget(s.sumtg2)
e2:SetOperation(s.sumop2)
c:RegisterEffect(e2)
end
function s.sumfilter(c,ec)
local e1=Effect.CreateEffect(ec)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local res=c:IsSummonable(true,nil,1)
e1:Reset()
return res
end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil,c):GetFirst()
if tc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.Summon(tp,tc,true,nil,1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e3,true)
end
end
function s.sumcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.sumtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function s.sumop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(s.sumfilter,1-tp,LOCATION_HAND,0,1,nil,c) and Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(1-tp,s.sumfilter,1-tp,LOCATION_HAND,0,1,1,nil,c):GetFirst()
if tc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.Summon(1-tp,tc,true,nil,1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e3,true)
end
end
end
\ No newline at end of file
--アンティーク・ギアドラゴン
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,83104731)
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.FALSE)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(s.ntcon)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.discon)
e2:SetCost(s.discost)
e2:SetTarget(s.distg)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH)
end
function s.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and (Duel.IsExistingMatchingCard(s.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) and not Duel.IsExistingMatchingCard(aux.NOT(s.cfilter),c:GetControler(),LOCATION_MZONE,0,1,nil) or not Duel.IsExistingMatchingCard(nil,c:GetControler(),LOCATION_MZONE,0,1,nil))
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return ep==1-tp
and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function s.cgfilter(c)
return (c:IsRace(RACE_MACHINE) and c:IsLocation(LOCATION_HAND+LOCATION_MZONE)
or c:IsCode(83104731) and c:IsLocation(LOCATION_DECK))
and c:IsAbleToGraveAsCost() and c:IsFaceupEx()
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cgfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cgfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--炎王妃 ウルカニクス
local s,id,o=GetID()
function s.initial_effect(c)
--destroy & to_hand & change_level
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.dfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
end
function s.thfilter(c)
return not c:IsCode(id) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToHand() and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND+LOCATION_MZONE,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local c=e:GetHandler()
local dg=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,c)
if dg:GetCount()>0 and Duel.Destroy(dg,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local thg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if thg:GetCount()>0 then
local th=Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg)
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local lv=thg:GetFirst():GetLevel()
if th*lv>0 and c:GetLevel()~=lv and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function s.spfilter(c,e,tp)
return c:IsCode(23015896) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.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,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--デーモンの光来
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,79791878)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(s.ntcon)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetTarget(s.cttg)
e2:SetOperation(s.ctop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCondition(s.atkcon)
e4:SetTarget(s.atktg)
e4:SetValue(500)
c:RegisterEffect(e4)
end
function s.ntfilter(c)
return c:IsFaceup() and c:IsCode(79791878)
end
function s.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.ntfilter,c:GetControler(),LOCATION_ONFIELD,0,1,nil)
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
if Duel.IsExistingMatchingCard(s.ntfilter,c:GetControler(),LOCATION_ONFIELD,0,1,nil) then
e:SetLabel(1)
end
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp,PHASE_END,1)~=0
and e:GetLabel()~=1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function s.atkcon(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function s.atktg(e,c)
return c~=e:GetHandler()
end
\ No newline at end of file
--ファントム・オブ・ユベル
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunFun(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1a5),s.ffilter,1,true)
aux.AddContactFusionProcedure(c,s.cfilter,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,aux.tdcfop(c))
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id)
e4:SetCondition(s.chcon)
e4:SetCost(s.chcost)
e4:SetTarget(s.chtg)
e4:SetOperation(s.chop)
c:RegisterEffect(e4)
end
function s.ffilter(c)
return c:IsRace(RACE_FIEND) and c:IsAttack(0) and c:IsDefense(0)
end
function s.cfilter(c)
return c:IsType(TYPE_MONSTER)
and c:IsAbleToDeckOrExtraAsCost()
end
function s.chcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function s.chcost(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 s.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1a5) and c:IsFaceupEx()
end
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,rp,0,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,1,e:GetHandler()) end
end
function s.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,s.repop)
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(1-tp,s.filter,tp,0,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--Psychic Processor
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1,id+o)
e3:SetRange(LOCATION_REMOVED)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.spcost(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 s.spfilter(c,e,tp)
return c:IsRace(RACE_MACHINE+RACE_PSYCHO+RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if ft>2 then ft=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,ft,nil,e,tp)
local tc=g:GetFirst()
while tc do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,true)
end
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetHandler():GetTurnID()+1
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--Psychic Arsenal
local s,id,o=GetID()
function s.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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function s.cfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and Duel.CheckLPCost(tp,c:GetLevel()*200)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetLevel(),c:GetAttribute())
end
function s.thfilter(c,lv,att)
return c:IsRace(RACE_MACHINE) and bit.band(c:GetAttribute(),att)~=0 and c:GetLevel()>lv and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.cfilter(chkc,tp) end
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst()
Duel.PayLPCost(tp,tc:GetLevel()*200)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetLevel(),tc:GetAttribute())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function s.tdfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsCanBeEffectTarget(e)
and (c:IsAbleToDeck() or c:IsAbleToHand(e,0,tp))
and c:IsRace(RACE_MACHINE+RACE_PSYCHO)
end
function s.fselect(g,e,tp)
return g:IsExists(Card.IsAbleToDeck,1,nil) and g:IsExists(Card.IsAbleToHand,1,nil)
and g:IsExists(Card.IsRace,1,nil,RACE_MACHINE) and g:IsExists(Card.IsRace,1,nil,RACE_PSYCHO)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local dg=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_REMOVED,0,nil,e,tp)
if chkc then return false end
if chk==0 then return dg:CheckSubGroup(s.fselect,2,2,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=dg:SelectSubGroup(tp,s.fselect,false,2,2,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.thfilter2(c,e,tp)
return c:IsAbleToDeck()
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=tg:FilterSelect(tp,s.thfilter2,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.HintSelection(sg)
aux.PlaceCardsOnDeckBottom(tp,sg)
tg:Sub(sg)
if sg:GetFirst():IsLocation(LOCATION_DECK+LOCATION_EXTRA) and tg:GetCount()>0 and tg:GetFirst():IsAbleToHand() then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
end
end
--Emergency Apport
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
return c:IsFaceupEx() and c:IsRace(RACE_PSYCHO) and c:IsLevelBelow(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.activate(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
\ No newline at end of file
--Conbirdable
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.filter(c,e,tp)
return not c:IsCode(id) and c:IsLevelAbove(5) and c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sg)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function s.tfilter(c,tp)
return c:IsFacedown() and Duel.GetMZoneCount(tp,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tfilter(chkc,tp) end
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.IsExistingTarget(s.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,s.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
end
end
end
\ No newline at end of file
--Swarm of Centipedes
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(s.postg)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsCanTurnSet() or c:IsFacedown() or c:IsPosition(POS_FACEUP_DEFENSE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then
if tc:IsPosition(POS_FACEUP_DEFENSE) then
if tc:IsCanTurnSet() and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
elseif tc:IsCanTurnSet() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
elseif tc:IsFacedown() then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
end
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(id)==0 end
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--Sunset Beat
local s,id,o=GetID()
function s.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(id,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id+o)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCondition(s.damcon)
e2:SetTarget(s.damtg)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
end
function s.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsFacedown() and c:IsControler(tp)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.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 s.cfilter2(c,tp,e)
return c:IsPreviousPosition(POS_FACEDOWN) and c:IsFaceup() and c:IsControler(tp) and c:IsType(TYPE_FLIP) and c:IsCanBeEffectTarget(e)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter2,1,nil,tp,e)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and chkc:IsPreviousControler(tp)
and chkc:IsPreviousLocation(LOCATION_MZONE) and s.cfilter2(chkc,tp,e) end
local g=eg:Filter(s.cfilter2,nil,tp,e)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE) and #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
Duel.SetTargetCard(tc)
e:SetLabelObject(tc)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,tc:GetLevel()*200)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if not tc:IsRelateToEffect(e) or not tc:IsPosition(POS_FACEUP) or not tc:IsType(TYPE_MONSTER) then return end
Duel.Damage(1-tp,tc:GetLevel()*200,REASON_EFFECT)
end
\ No newline at end of file
--Tricorn the Cacophonous Concept
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+id)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetCondition(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.spcfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousControler(tp)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(s.spcfilter,1,nil,0) then v=v+1 end
if eg:IsExists(s.spcfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+id,re,r,rp,ep,e:GetLabel())
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return ev==tp or ev==PLAYER_ALL
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.cfilter(c,race,att)
return c:IsFaceup() and bit.band(c:GetRace(),race)~=0 and bit.band(c:GetAttribute(),att)~=0
end
function s.thfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,0,1,nil,c:GetRace(),c:GetAttribute())
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--Swallow's Cowrie
local s,id,o=GetID()
function s.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:SetLabel(0)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function s.cfilter(c,tp)
return c:IsRace(RACE_WINDBEAST) and c:IsReleasable() and c:IsFaceupEx()
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetLevel())
end
function s.thfilter(c,lv)
return c:IsRace(RACE_WINDBEAST) and c:IsLevel(lv) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp,true):Filter(s.cfilter,nil,tp)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return g:GetCount()>=1
end
local rg=g:FilterSelect(tp,s.cfilter,1,1,nil,tp)
e:SetLabel(rg:GetFirst():GetLevel())
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,lv)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--Xyz Force
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.tgfilter(c,b)
return not c:IsCode(id) and c:IsSetCard(0x73) and (c:IsAbleToGrave() or b and c:IsAbleToHand())
end
function s.mfilter(c)
return c:IsType(TYPE_XYZ)
end
function s.ffilter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup() and c:GetOverlayGroup():IsExists(s.mfilter,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b=Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,b) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local b=Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,b)
local tc=g:GetFirst()
if tc then
if b and tc:IsAbleToHand() and tc:IsAbleToGrave() and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
elseif b and tc:IsAbleToHand() and not tc:IsAbleToGrave() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
elseif tc:IsAbleToGrave() then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,1,1,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,nil,tp,LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if Duel.RemoveOverlayCard(tp,1,1,1,1,REASON_EFFECT)~=0 then
local g=Duel.GetOperatedGroup()
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsType(TYPE_XYZ) and tc:GetOwner()==tp
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and tc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
and not tc:IsHasEffect(EFFECT_NECRO_VALLEY)
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end
\ No newline at end of file
--Veidos the Eruption Dragon of Extinction
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsLocation(LOCATION_FZONE) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_FZONE,LOCATION_FZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.thfilter(c)
return c:IsType(TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0x2ad) and c:IsAbleToHand()
end
function s.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0x2ad) and c:IsSSetable()
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP)>0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
if not b1 and not b2 then return end
local op=aux.SelectFromOptions(tp,
{b1,1190},
{b2,1153},
{true,aux.Stringid(id,2)})
if op<3 then Duel.BreakEffect() end
if op==1 then
local thc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(thc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thc)
elseif op==2 then
local stc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SSet(tp,stc)
end
end
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(1-tp)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
\ No newline at end of file
--King of the Ashened City
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.sprcon)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,id+o)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.sprfilter(c)
return c:IsFaceup() and c:IsCode(101203094)
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x2ad) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.atkfilter(c)
return c:IsFaceup() and c:IsAttackAbove(2800)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) or Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.atkfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if Duel.IsExistingMatchingCard(s.atkfilter,tp,0,LOCATION_MZONE,1,nil) then
g:Merge(Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp))
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil)
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--Hero of the Ashened City
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.sprcon)
c:RegisterEffect(e1)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.sprfilter(c)
return c:IsFaceup() and c:IsCode(101203094)
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function s.desfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PYRO)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.setfilter(c)
return c:IsCode(101203094) and not c:IsForbidden()
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and Duel.Destroy(tc,REASON_EFFECT)>0 and tc:GetPreviousCodeOnField()==101203090 and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
local tc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--Priestess of the Ashened City
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.sprcon)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function s.sprfilter(c)
return c:IsFaceup() and c:IsCode(101203094)
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function s.thfilter(c)
return c:IsSetCard(0x2ad) and not c:IsCode(id) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.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
\ No newline at end of file
--Obsidim, The Ashened City
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--race
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(s.ratg)
e2:SetValue(RACE_PYRO)
c:RegisterEffect(e2)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,id)
e3:SetCondition(s.tdcon)
e3:SetTarget(s.tdtg)
e3:SetOperation(s.tdop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetDescription(1152)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,id+o)
e4:SetCondition(s.spcon)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_REMOVE)
c:RegisterEffect(e5)
end
function s.ratg(e,c)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer() and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function s.tdfilter(c)
return c:IsCode(id) and c:IsAbleToDeck()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsPlayerCanDraw(tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 and Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_FZONE)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x2ad) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.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)
Duel.ShuffleDeck(tp)
end
end
\ No newline at end of file
--Awakening of Veidos
local s,id,o=GetID()
function s.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:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.setfilter(c)
return c:IsCode(101203094) and not c:IsForbidden()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_PYRO) and c:IsLevelAbove(5)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local p=tp
if Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))==1 then
p=1-p
end
if tc then
local fc=Duel.GetFieldCard(p,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
if Duel.MoveToField(tc,tp,p,LOCATION_FZONE,POS_FACEUP,true) and Duel.GetFieldGroupCount(tp,0,LOCATION_FZONE)>0 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsRace(RACE_PYRO) and c:IsLocation(LOCATION_DECK+LOCATION_EXTRA)
end
\ No newline at end of file
--Ashened For Eternity
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--get control
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.contrtg)
e2:SetOperation(s.controp)
c:RegisterEffect(e2)
end
function s.thfilter(c)
return (c:IsCode(101203090) or c:IsSetCard(0x2ad) and c:IsType(TYPE_MONSTER)) and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function s.contrfilter(c,tp)
return c:GetOwner()==tp and c:IsControlerCanBeChanged()
end
function s.contrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.contrfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.contrfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,s.contrfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function s.controp(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and Duel.GetControl(tc,tp) and tc:IsLocation(LOCATION_MZONE) and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
for ac in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(-tc:GetBaseAttack())
ac:RegisterEffect(e1)
end
end
end
\ No newline at end of file
--ミュステリオンの竜冠
function c13735899.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),true)
--cannot be fusion material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--ATK down
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetValue(c13735899.atkval)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13735899,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,13735899)
e3:SetCondition(c13735899.remcon)
e3:SetTarget(c13735899.remtg)
e3:SetOperation(c13735899.remop)
c:RegisterEffect(e3)
end
function c13735899.atkval(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_REMOVED,0)*-100
end
function c13735899.cfilter(c,e)
local typ,se=c:GetSpecialSummonInfo(SUMMON_INFO_TYPE,SUMMON_INFO_REASON_EFFECT)
if not se then return false end
local sc=se:GetHandler()
return typ&TYPE_MONSTER~=0 and se:IsActivated()
and c:IsFaceup() and (c:GetOriginalRace()==sc:GetOriginalRace() or c==sc)
and c:IsCanBeEffectTarget(e) and Duel.IsExistingMatchingCard(c13735899.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,c)
end
function c13735899.remcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c13735899.cfilter,1,nil,e)
and not eg:IsContains(e:GetHandler())
end
function c13735899.rmfilter(c,tc)
return c:IsFaceup() and c:GetOriginalRace()==tc:GetOriginalRace() and c:IsAbleToRemove()
end
function c13735899.remtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c13735899.cfilter(chkc,e) end
if chk==0 then return true end
local tc=eg:GetFirst()
if #eg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
tc=eg:FilterSelect(tp,c13735899.cfilter,1,1,nil,e):GetFirst()
end
Duel.SetTargetCard(tc)
local g=Duel.GetMatchingGroup(c13735899.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tc)
g:AddCard(tc)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function c13735899.remop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local g=Group.FromCards(tc)
if tc:IsFaceup() then
g=g+Duel.GetMatchingGroup(c13735899.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tc)
end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
--ファイナル・ギアス
function c16832845.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_TOGRAVE)
e1:SetCondition(c16832845.condition)
e1:SetTarget(c16832845.target)
e1:SetOperation(c16832845.activate)
c:RegisterEffect(e1)
if not c16832845.global_check then
c16832845.global_check=true
c16832845[0]=false
c16832845[1]=false
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(c16832845.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c16832845.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c16832845.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:GetOriginalLevel()>=7 and tc:IsPreviousLocation(LOCATION_MZONE) then
c16832845[tc:GetPreviousControler()]=true
end
tc=eg:GetNext()
end
end
function c16832845.clear(e,tp,eg,ep,ev,re,r,rp)
c16832845[0]=false
c16832845[1]=false
end
function c16832845.condition(e,tp,eg,ep,ev,re,r,rp)
return c16832845[0] and c16832845[1]
end
function c16832845.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c16832845.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c16832845.spfilter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsLocation(LOCATION_REMOVED) and c:GetLevel()>0
end
function c16832845.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16832845.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(c16832845.spfilter,nil,e,tp)
if og:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(16832845,0)) then
Duel.BreakEffect()
local sg=og:GetMaxGroup(Card.GetLevel)
if sg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,1,1,nil)
end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--PSYフレームギア・ε
function c1697104.initial_effect(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c1697104.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1697104,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(c1697104.condition)
e2:SetTarget(c1697104.target)
e2:SetOperation(c1697104.operation)
c:RegisterEffect(e2)
end
function c1697104.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c1697104.condition(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsPlayerAffectedByEffect(tp,8802510))
and ep~=tp and re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c1697104.spfilter(c,e,tp)
return c:IsCode(49036338) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1697104.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c1697104.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
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 c1697104.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c1697104.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
local fid=c:GetFieldID()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(1697104,RESET_EVENT+RESETS_STANDARD,0,1,fid)
c:RegisterFlagEffect(1697104,RESET_EVENT+RESETS_STANDARD,0,1,fid)
Duel.SpecialSummonComplete()
g:AddCard(c)
g:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g)
e1:SetCondition(c1697104.rmcon)
e1:SetOperation(c1697104.rmop)
Duel.RegisterEffect(e1,tp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c1697104.rmfilter(c,fid)
return c:GetFlagEffectLabel(1697104)==fid
end
function c1697104.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c1697104.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c1697104.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c1697104.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
--超重蒸鬼テツドウ-O
function c17775525.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x9a),aux.NonTuner(Card.IsSetCard,0x9a),2)
c:EnableReviveLimit()
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17775525,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c17775525.cost)
e2:SetTarget(c17775525.target)
e2:SetOperation(c17775525.operation)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17775525,1))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c17775525.rmtg)
e3:SetOperation(c17775525.rmop)
c:RegisterEffect(e3)
end
function c17775525.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
local rt=Duel.GetTargetCount(nil,tp,0,LOCATION_ONFIELD,nil)
if rt>2 then rt=2 end
local cg=Duel.DiscardHand(tp,Card.IsDiscardable,1,rt,REASON_COST+REASON_DISCARD,nil)
e:SetLabel(cg)
end
function c17775525.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,ct,0,0)
end
function c17775525.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
if rg:GetCount()>0 then
Duel.Destroy(rg,REASON_EFFECT)
end
end
function c17775525.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function c17775525.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17775525.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(c17775525.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetCount()*200)
end
function c17775525.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c17775525.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
local ct=Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
if ct>0 then
Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end
end
--sophiaの影霊衣
function c21105106.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c21105106.splimit)
c:RegisterEffect(e1)
--cannot spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c21105106.discon)
e2:SetCost(c21105106.discost)
e2:SetOperation(c21105106.disop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c21105106.rmcon)
e3:SetCost(c21105106.rmcost)
e3:SetTarget(c21105106.rmtg)
e3:SetOperation(c21105106.rmop)
c:RegisterEffect(e3)
end
function c21105106.splimit(e,se,sp,st)
return e:GetHandler():IsLocation(LOCATION_HAND) and bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c21105106.mat_filter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function c21105106.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c21105106.cfilter(c)
return c:IsSetCard(0xb4) and c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function c21105106.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c21105106.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c21105106.cfilter,tp,LOCATION_HAND,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_DISCARD+REASON_COST)
end
function c21105106.disop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_MAIN1)
e1:SetTargetRange(0,1)
e1:SetTarget(c21105106.sumlimit)
Duel.RegisterEffect(e1,tp)
end
function c21105106.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
function c21105106.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c21105106.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0
and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==1 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e3,tp)
end
function c21105106.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c21105106.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,aux.ExceptThisCard(e))
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function c21105106.mat_group_check(g)
return #g==3 and g:GetClassCount(Card.GetRace)==3
end
--督戦官コヴィントン
function c22666164.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22666164,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c22666164.cost)
e1:SetTarget(c22666164.target)
e1:SetOperation(c22666164.operation)
c:RegisterEffect(e1)
end
c22666164.spchecks=aux.CreateChecks(Card.IsCode,{60999392,23782705,96384007})
function c22666164.spcostfilter(c)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and c:IsCode(60999392,23782705,96384007)
end
function c22666164.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c22666164.spcostfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return g:CheckSubGroupEach(c22666164.spchecks,aux.mzctcheck,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroupEach(tp,c22666164.spchecks,false,aux.mzctcheck,tp)
Duel.SendtoGrave(sg,REASON_COST)
end
function c22666164.filter(c,e,tp)
return c:IsCode(58054262) and c:IsCanBeSpecialSummoned(e,0,tp,false,true)
end
function c22666164.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c22666164.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c22666164.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,c22666164.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,true,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
end
--GP-リオン
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon self
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--spsummon grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id+o)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--synchro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id+o*2)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e4:SetCondition(s.scon)
e4:SetTarget(s.stg)
e4:SetOperation(s.sop)
c:RegisterEffect(e4)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end
end
function s.filter(c,e,tp)
return not c:IsRace(RACE_WARRIOR) and c:IsSetCard(0x192)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(0x192) and c:IsLocation(LOCATION_EXTRA)
end
function s.scon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function s.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetSynchroMaterial(tp):Filter(Card.IsSetCard,nil,0x192)
if chk==0 then return #g>0 and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,g) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.sop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetSynchroMaterial(tp):Filter(Card.IsSetCard,nil,0x192)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil,g):GetFirst()
if sc then Duel.SynchroSummon(tp,sc,nil,g) end
end
--アース・グラビティ
function c26509612.initial_effect(c)
aux.AddSetNameMonsterList(c,0x3008)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_BATTLE_START)
e1:SetCondition(c26509612.condition)
e1:SetTarget(c26509612.target)
e1:SetOperation(c26509612.activate)
c:RegisterEffect(e1)
end
function c26509612.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
end
function c26509612.filter1(c)
return c:IsFaceup() and c:IsCode(74711057)
end
function c26509612.filter2(c)
return c:IsFaceup() and c:IsLevelBelow(4)
end
function c26509612.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26509612.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c26509612.filter2,tp,0,LOCATION_MZONE,1,nil) end
end
function c26509612.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_MUST_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(c26509612.attg)
e1:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetValue(c26509612.atklimit)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e3:SetValue(1)
Duel.RegisterEffect(e3,tp)
end
function c26509612.attg(e,c)
return c:IsLevelBelow(4)
end
function c26509612.atklimit(e,c)
return not c:IsCode(74711057) or c:IsFacedown()
end
--隠し砦 ストロング・ホールド
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,79791878)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.atkcon)
e2:SetValue(s.atkval)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,0,2000,4,RACE_MACHINE,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,0,2000,4,RACE_MACHINE,ATTRIBUTE_EARTH) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)
end
function s.atkfilter(c)
return (c:IsCode(79791878) or (aux.IsCodeListed(c,79791878) and c:IsLocation(LOCATION_MZONE))) and c:IsFaceup()
end
function s.atkcon(e)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function s.atkval(e,c)
local tp=e:GetHandlerPlayer()
return Duel.GetMatchingGroupCount(s.atkfilter,tp,LOCATION_ONFIELD,0,nil)*1000
end
function s.filter(c)
return c:IsCode(79791878) and c:IsFaceup()
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil)
and e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetAttacker()
if chk==0 then return tg:IsOnField() end
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
end
function s.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
--蛇眼の大炎魔
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.mvcon)
e1:SetTarget(s.mvtg)
e1:SetOperation(s.mvop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id+o)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(s.mvcon2)
e2:SetTarget(s.mvtg2)
e2:SetOperation(s.mvop2)
c:RegisterEffect(e2)
end
function s.mvcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=c:GetBattleTarget()
local ft1=0
local ft2=0
if c:GetOwner()==tp then
ft1=ft1+1
else
ft2=ft2+1
end
if ac and ac:GetOwner()==tp then
ft1=ft1+1
else
ft2=ft2+1
end
e:SetLabelObject(ac)
return ac and ac:IsControler(1-tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>=ft1
and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>=ft2
end
function s.mvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=e:GetLabelObject()
if not ac:IsRelateToBattle() or not c:IsRelateToEffect(e) then return false end
local ft1=0
local ft2=0
if c:GetOwner()==tp then
ft1=ft1+1
else
ft2=ft2+1
end
if ac and ac:GetOwner()==tp then
ft1=ft1+1
else
ft2=ft2+1
end
if not (Duel.GetLocationCount(tp,LOCATION_SZONE)>=ft1)
or not (Duel.GetLocationCount(1-tp,LOCATION_SZONE)>=ft2) then return false end
if not ac:IsControler(1-tp) then return false end
if ac:IsType(TYPE_MONSTER) and not ac:IsImmuneToEffect(e)
and Duel.MoveToField(ac,tp,ac:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
ac:RegisterEffect(e1)
end
if not c:IsImmuneToEffect(e)
and Duel.MoveToField(c,tp,c:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
end
end
function s.mvcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS)
end
function s.filter2(c,tp)
return not c:IsCode(id) and c:IsAttribute(ATTRIBUTE_FIRE)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function s.mvtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.filter2(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter2,tp,LOCATION_GRAVE,0,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.mvop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
end
--水晶機巧-フェニキシオン
function c2743001.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSynchroType,TYPE_SYNCHRO),aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2743001,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c2743001.rmcon)
e1:SetTarget(c2743001.rmtg)
e1:SetOperation(c2743001.rmop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(2743001,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c2743001.spcon)
e2:SetTarget(c2743001.sptg)
e2:SetOperation(c2743001.spop)
c:RegisterEffect(e2)
end
c2743001.material_type=TYPE_SYNCHRO
function c2743001.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c2743001.rmfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function c2743001.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c2743001.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c2743001.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c2743001.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c2743001.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c2743001.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO) and bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c2743001.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c2743001.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c2743001.spfilter(chkc,e,tp) and chkc~=e:GetHandler() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c2743001.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c2743001.spfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c2743001.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
--PSYフレームギア・β
function c2810642.initial_effect(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c2810642.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(2810642,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(c2810642.condition)
e2:SetTarget(c2810642.target)
e2:SetOperation(c2810642.operation)
c:RegisterEffect(e2)
end
function c2810642.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c2810642.condition(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsPlayerAffectedByEffect(tp,8802510))
and Duel.GetAttacker():GetControler()~=tp
end
function c2810642.spfilter(c,e,tp)
return c:IsCode(49036338) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c2810642.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.GetAttacker():IsRelateToBattle()
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c2810642.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetTargetCard(Duel.GetAttacker())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,Duel.GetAttacker(),1,0,0)
end
function c2810642.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c2810642.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
local fid=c:GetFieldID()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(2810642,RESET_EVENT+RESETS_STANDARD,0,1,fid)
c:RegisterFlagEffect(2810642,RESET_EVENT+RESETS_STANDARD,0,1,fid)
Duel.SpecialSummonComplete()
g:AddCard(c)
g:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g)
e1:SetCondition(c2810642.rmcon)
e1:SetOperation(c2810642.rmop)
Duel.RegisterEffect(e1,tp)
local dc=Duel.GetFirstTarget()
if dc:IsRelateToEffect(e) and Duel.Destroy(dc,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
end
end
function c2810642.rmfilter(c,fid)
return c:GetFlagEffectLabel(2810642)==fid
end
function c2810642.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c2810642.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c2810642.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c2810642.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
--転生炎獣パイロ・フェニックス
function c31313405.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c31313405.matfilter,2)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31313405,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c31313405.descon)
e1:SetTarget(c31313405.destg)
e1:SetOperation(c31313405.desop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c31313405.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(31313405,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,31313405)
e3:SetTarget(c31313405.sptg)
e3:SetOperation(c31313405.spop)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(31313405,2))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,31313406)
e4:SetTarget(c31313405.damtg)
e4:SetOperation(c31313405.damop)
c:RegisterEffect(e4)
end
function c31313405.matfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsLinkAttribute(ATTRIBUTE_FIRE)
end
function c31313405.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsLinkCode,1,nil,31313405) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c31313405.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and e:GetLabel()==1
end
function c31313405.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c31313405.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c31313405.spfilter(c,e,tp)
return c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function c31313405.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c31313405.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsExistingTarget(c31313405.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c31313405.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c31313405.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP)
end
end
function c31313405.cfilter(c,e,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsType(TYPE_LINK) and c:GetBaseAttack()>0 and c:IsCanBeEffectTarget(e) and c:IsLocation(LOCATION_MZONE)
end
function c31313405.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c31313405.cfilter(chkc,e,1-tp) end
if chk==0 then return eg:IsExists(c31313405.cfilter,1,nil,e,1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=eg:FilterSelect(tp,c31313405.cfilter,1,1,nil,e,1-tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetBaseAttack())
end
function c31313405.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Damage(1-tp,tc:GetBaseAttack(),REASON_EFFECT)
end
end
--天極輝艦-熊斗竜巧
function c33250142.initial_effect(c)
c:EnableReviveLimit()
--spsummon restriction
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c33250142.splimit)
c:RegisterEffect(e0)
--to hand (deck)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33250142,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c33250142.thcon1)
e1:SetTarget(c33250142.thtg1)
e1:SetOperation(c33250142.thop1)
c:RegisterEffect(e1)
--to hand (remove)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33250142,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c33250142.thtg2)
e2:SetOperation(c33250142.thop2)
c:RegisterEffect(e2)
end
function c33250142.splimit(e,se,sp,st)
return se:GetHandler():IsCode(89771220)
end
function c33250142.cfilter1(c,tp)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsControler(tp)
end
function c33250142.thcon1(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c33250142.cfilter1,1,nil,tp)
end
function c33250142.thfilter1(c)
return c:IsSetCard(0x163,0x154) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c33250142.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33250142.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c33250142.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c33250142.thfilter1,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 c33250142.thfilter2(c)
return c33250142.thfilter1(c) and c:IsFaceup()
end
function c33250142.thtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c33250142.thfilter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33250142.thfilter2,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c33250142.thfilter2,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c33250142.thop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--ヴァルモニカ・インヴィターレ
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOEXTRA+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x1a3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.thfilter(c,tp)
return c:IsSetCard(0x1a3) and c:IsType(TYPE_PENDULUM)
and (c:IsAbleToExtra() or c:IsAbleToHand())
end
function s.cfilter(c)
return not c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x1a3) and c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b2=g:CheckSubGroup(s.Group,2,2)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return b1 or b2 end
end
function s.thfilter2(c,g)
return c:IsAbleToExtra() and g:FilterCount(Card.IsAbleToHand,c)==1
end
function s.Group(g)
return aux.dncheck(g) and g:FilterCount(s.thfilter2,nil,g)~=0
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b2=g:CheckSubGroup(s.Group,2,2)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))+1
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(id,1))+1
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(id,2))+2
end
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:SelectSubGroup(tp,s.Group,false,2,2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=sg:FilterSelect(tp,Card.IsAbleToHand,1,1,nil):GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
sg:RemoveCard(tc)
Duel.SendtoExtraP(sg,nil,REASON_EFFECT)
end
end
function s.aclimit(e,re,tp)
local c=re:GetHandler()
return not c:IsSetCard(0x1a3) and re:IsActiveType(TYPE_MONSTER) and c:IsLocation(LOCATION_MZONE)
end
\ No newline at end of file
--PSYフレームギア・γ
function c38814750.initial_effect(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c38814750.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(38814750,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(c38814750.condition)
e2:SetTarget(c38814750.target)
e2:SetOperation(c38814750.operation)
c:RegisterEffect(e2)
end
function c38814750.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c38814750.condition(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsPlayerAffectedByEffect(tp,8802510))
and ep~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c38814750.spfilter(c,e,tp)
return c:IsCode(49036338) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c38814750.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c38814750.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
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 c38814750.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c38814750.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
local fid=c:GetFieldID()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(38814750,RESET_EVENT+RESETS_STANDARD,0,1,fid)
c:RegisterFlagEffect(38814750,RESET_EVENT+RESETS_STANDARD,0,1,fid)
Duel.SpecialSummonComplete()
g:AddCard(c)
g:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g)
e1:SetCondition(c38814750.rmcon)
e1:SetOperation(c38814750.rmop)
Duel.RegisterEffect(e1,tp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c38814750.rmfilter(c,fid)
return c:GetFlagEffectLabel(38814750)==fid
end
function c38814750.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c38814750.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c38814750.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c38814750.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
--天盃龍パイドラ
local s,id,o=GetID()
function c39931513.initial_effect(c)
--to hand or set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--avoid battle damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(s.target)
e3:SetValue(1)
c:RegisterEffect(e3)
--synchro effect
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50091196,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_STEP_END+TIMING_BATTLE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(s.sccon)
e4:SetTarget(s.sctarg)
e4:SetOperation(s.scop)
c:RegisterEffect(e4)
end
function s.thfilter(c)
if not (c:IsSetCard(0x1a9) and c:IsType(TYPE_SPELL+TYPE_TRAP)) then return false end
return c:IsAbleToHand() or c:IsSSetable()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,0))
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsSSetable() or Duel.SelectOption(tp,1190,1153)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SSet(tp,tc)
end
end
end
function s.target(e,c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_DRAGON)
end
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function s.mfilter(c)
return not c:IsStatus(STATUS_SUMMONING)
end
function s.sctarg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c,mg) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local mg=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
end
end
\ No newline at end of file
--転臨の守護竜
function c40003819.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,40003819+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c40003819.target)
e1:SetOperation(c40003819.activate)
c:RegisterEffect(e1)
end
function c40003819.filter0(c)
return c:IsOnField() and c:IsType(TYPE_LINK) and c:IsAbleToRemove()
end
function c40003819.filter1(c,e)
return c:IsOnField() and c:IsType(TYPE_LINK) and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c40003819.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c40003819.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsType(TYPE_LINK) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c40003819.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c40003819.filter0,nil)
local mg2=Duel.GetMatchingGroup(c40003819.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c40003819.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
mg3=mg3:Filter(Card.IsType,nil,TYPE_LINK)
res=Duel.IsExistingMatchingCard(c40003819.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c40003819.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c40003819.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c40003819.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c40003819.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
mg3=mg3:Filter(Card.IsType,nil,TYPE_LINK)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c40003819.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
local exmg=mg3~=nil and mg3:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_DECK) or 0
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or #exmg<1 or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--スタンドアップ・センチュリオン!
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetCost(s.reg)
c:RegisterEffect(e0)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetRange(LOCATION_FZONE)
e1:SetCondition(s.con)
e1:SetValue(aux.indoval)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.setcon)
e2:SetCost(s.setcost)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
--synchro summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.sccon)
e3:SetTarget(s.sctg)
e3:SetOperation(s.scop)
c:RegisterEffect(e3)
end
function s.reg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function s.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x1a2) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function s.con(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)~=0
end
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end
function s.filter(c)
return c:IsSetCard(0x1a2) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
function s.scconfilter(c,tp)
return c:IsFaceup()
end
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.scconfilter,1,nil,tp)
end
function s.mfilter(c)
return c:IsSetCard(0x1a2) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function s.syncheck(g,tp,syncard)
return g:IsExists(s.mfilter,1,nil) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1) and aux.SynMixHandCheck(g,tp,syncard)
end
function s.scfilter(c,tp,mg)
return mg:CheckSubGroup(s.syncheck,2,#mg,tp,c)
end
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_EXTRA,0,1,nil,tp,mg)
end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local g=Duel.GetMatchingGroup(s.scfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
end
end
--PSYフレーム・サーキット
function c575512.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--synchro summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(575512,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c575512.sccon)
e2:SetTarget(c575512.sctg)
e2:SetOperation(c575512.scop)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(575512,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_START)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(c575512.atkcon)
e3:SetCost(c575512.atkcost)
e3:SetOperation(c575512.atkop)
c:RegisterEffect(e3)
end
function c575512.scfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xc1) and c:IsControler(tp)
end
function c575512.sccon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c575512.scfilter,1,nil,tp)
end
function c575512.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetSynchroMaterial(tp):Filter(Card.IsSetCard,nil,0xc1)
return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c575512.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetSynchroMaterial(tp):Filter(Card.IsSetCard,nil,0xc1)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
function c575512.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc)
return tc and tc:IsControler(tp) and tc:IsSetCard(0xc1) and tc:IsRelateToBattle() and Duel.GetAttackTarget()~=nil
end
function c575512.atkfilter(c)
return c:IsSetCard(0xc1) and c:GetAttack()>0 and c:IsDiscardable()
end
function c575512.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c575512.atkfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c575512.atkfilter,tp,LOCATION_HAND,0,1,1,nil)
e:SetLabel(g:GetFirst():GetAttack())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c575512.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--時の沈黙-ターン・サイレンス
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,79791878)
--level up
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.lvtg)
e1:SetOperation(s.lvop)
c:RegisterEffect(e1)
--end the battle phase
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(s.bacon)
e2:SetCost(aux.bfgcost)
e2:SetOperation(s.baop)
c:RegisterEffect(e2)
end
function s.lvfilter(c)
return c:IsFaceup() and c:IsLevelAbove(1)
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.nfilter1(c)
return c:IsFaceup() and c:IsCode(79791878)
end
function s.nfilter2(c)
return c:IsFaceup() and aux.IsCodeListed(c,79791878)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(3)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
local ct=Duel.GetCurrentChain()
if ct<2 then return end
local te,tep=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
if tep==1-tp and te:IsActiveType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(s.nfilter1,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(s.nfilter2,tp,LOCATION_MZONE,0,1,nil) then
Duel.NegateEffect(ct-1)
end
end
function s.bacon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
if not tc then return false end
e:SetLabelObject(tc)
return tc:IsFaceup() and aux.IsCodeListed(tc,79791878)
end
function s.baop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() then
Duel.NegateAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,Duel.GetTurnPlayer())
end
end
\ No newline at end of file
--マシンナーズ・フォース
function c58054262.initial_effect(c)
c:EnableReviveLimit()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c58054262.splimit)
c:RegisterEffect(e1)
--attack cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_COST)
e2:SetCost(c58054262.atcost)
e2:SetOperation(c58054262.atop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(58054262,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c58054262.spcost)
e3:SetTarget(c58054262.sptg)
e3:SetOperation(c58054262.spop)
c:RegisterEffect(e3)
end
c58054262.spchecks=aux.CreateChecks(Card.IsCode,{60999392,23782705,96384007})
function c58054262.splimit(e,se,sp,st)
return se:GetHandler():IsCode(22666164)
end
function c58054262.atcost(e,c,tp)
return Duel.CheckLPCost(tp,1000)
end
function c58054262.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,1000)
end
function c58054262.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c58054262.filter(c,code,e,tp)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58054262.sptargetfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(60999392,23782705,96384007) and c:IsCanBeEffectTarget(e)
end
function c58054262.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c58054262.sptargetfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetMZoneCount(tp,e:GetHandler())>=3
and g:CheckSubGroupEach(c58054262.spchecks)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroupEach(tp,c58054262.spchecks)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,3,0,0)
end
function c58054262.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<3 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
--破壊竜ガンドラ-ギガ・レイズ
function c58330108.initial_effect(c)
c:EnableReviveLimit()
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c58330108.spcon)
e1:SetTarget(c58330108.sptg)
e1:SetOperation(c58330108.spop)
c:RegisterEffect(e1)
--atk gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c58330108.value)
c:RegisterEffect(e2)
--variable effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(58330108,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c58330108.cost)
e3:SetTarget(c58330108.target)
e3:SetOperation(c58330108.operation)
c:RegisterEffect(e3)
end
function c58330108.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c58330108.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c58330108.cfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,c)
return g:CheckSubGroup(aux.mzctcheck,2,2,tp)
end
function c58330108.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c58330108.cfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c58330108.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_COST)
g:DeleteGroup()
end
function c58330108.value(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_REMOVED,LOCATION_REMOVED)*300
end
function c58330108.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c58330108.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xf5)
end
function c58330108.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local gc=Duel.GetMatchingGroup(c58330108.filter,tp,LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)
if chk==0 then
local b1=Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
local b3=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,c)
return (gc==1 and b1) or (gc==2 and b2) or (gc>2 and b3)
end
if gc==1 then
e:SetCategory(CATEGORY_DESTROY)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
else
e:SetCategory(CATEGORY_REMOVE)
local loc=LOCATION_ONFIELD
if gc>2 then loc=LOCATION_ONFIELD+LOCATION_GRAVE end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,loc,loc,c)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
end
function c58330108.operation(e,tp,eg,ep,ev,re,r,rp)
local gc=Duel.GetMatchingGroup(c58330108.filter,tp,LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)
if gc==1 then
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
elseif gc>=2 then
local loc=LOCATION_ONFIELD
if gc>2 then loc=LOCATION_ONFIELD+LOCATION_GRAVE end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,loc,loc,aux.ExceptThisCard(e))
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
--GP-Nブラスター
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,59900655)
--link summon
aux.AddLinkProcedure(c,s.mfilter,2,2,s.lcheck)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.tdcon)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
function s.mfilter(c)
return c:IsLevelAbove(0) and c:IsLinkSetCard(0x192)
end
function s.lcheck(g,lc)
return g:GetClassCount(Card.GetLevel)==g:GetCount()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function s.desfilter(c,tp,seq)
local sseq=c:GetSequence()
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) then
return sseq==5 and seq==3 or sseq==6 and seq==1 or sseq==3 and seq==5 or sseq==1 and seq==6
end
if c:IsLocation(LOCATION_SZONE) then
return sseq<5 and sseq==seq
end
if sseq<5 then
return math.abs(sseq-seq)==1 or sseq==1 and seq==5 or sseq==3 and seq==6
end
if sseq>=5 then
return sseq==5 and seq==1 or sseq==6 and seq==3
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local cg=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,tc,tp,tc:GetSequence())
if Duel.Destroy(tc,REASON_EFFECT)~=0 and Duel.GetLP(tp)<Duel.GetLP(1-tp) and #cg>0
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Destroy(cg,REASON_EFFECT)
end
end
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)>0
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function s.spfilter(c,e,tp)
return c:IsCode(59900655) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsExtraDeckMonster()
and Duel.SendtoDeck(c,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_EXTRA)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--サモン・ソーサレス
function c61665245.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.NOT(aux.FilterBoolFunction(Card.IsLinkType,TYPE_TOKEN)),2,99,c61665245.lcheck)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61665245,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,61665245)
e1:SetCondition(c61665245.spcon)
e1:SetTarget(c61665245.sptg)
e1:SetOperation(c61665245.spop)
c:RegisterEffect(e1)
end
function c61665245.lcheck(g)
return aux.SameValueCheck(g,Card.GetLinkRace)
end
function c61665245.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c61665245.spfilter1(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp,zone)
end
function c61665245.spfilter2(c,e,tp,rac)
return c:IsRace(rac) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c61665245.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=e:GetHandler():GetLinkedZone(1-tp)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
and Duel.IsExistingMatchingCard(c61665245.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c61665245.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=c:GetLinkedZone(1-tp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c61665245.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone):GetFirst()
local function makeDisable(dc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
if tc and Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE,zone) then
makeDisable(tc)
local g=Duel.GetMatchingGroup(c61665245.spfilter2,tp,LOCATION_DECK,0,nil,e,tp,tc:GetRace())
if #g>0 and Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(61665245,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil):GetFirst()
if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
makeDisable(sc)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c61665245.splimit)
e3:SetLabel(sc:GetOriginalRace())
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
end
end
end
function c61665245.splimit(e,c)
return c:GetOriginalRace()&e:GetLabel()==0
end
--Salamandra with Chain
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(aux.dscon)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,id)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(s.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
if e:GetOwner():IsRelateToChain(ev) then
e:GetOwner():CancelToGrave(false)
end
end
function s.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return e:IsCostChecked()
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.posfilter(c)
return c:IsType(TYPE_EFFECT) and c:IsFaceup() and c:IsCanTurnSet()
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Equip(tp,c,tc)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(700)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(s.eqlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
if Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
else
c:CancelToGrave(false)
end
end
function s.eqlimit(e,c)
return e:GetHandler():GetEquipTarget()==c
or c:IsAttribute(ATTRIBUTE_FIRE)
end
function s.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function s.filter1(c,e)
return c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_WARRIOR+RACE_DRAGON) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local mg2=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_GRAVE,0,nil,e)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
if mat1:IsExists(s.fdfilter,1,nil) then
local cg=mat1:Filter(s.fdfilter,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat1:IsExists(s.gdfilter,1,nil) then
local gg=mat1:Filter(s.gdfilter,nil)
Duel.HintSelection(gg)
end
Duel.SendtoDeck(mat1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
tc:CompleteProcedure()
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc)
e2:SetCondition(s.descon)
e2:SetOperation(aux.EPDestroyOperation)
Duel.RegisterEffect(e2,tp)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(id)~=0 then
return true
else
e:Reset()
return false
end
end
function s.fdfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND)
end
function s.gdfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)
end
\ No newline at end of file
--軍貫処 『海せん』
function c62200831.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to deck top
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(62200831,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(c62200831.dtcon)
e2:SetTarget(c62200831.dttg)
e2:SetOperation(c62200831.dtop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--pay and spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(62200831,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetCondition(c62200831.spcon)
e4:SetTarget(c62200831.sptg)
e4:SetOperation(c62200831.spop)
c:RegisterEffect(e4)
end
function c62200831.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x166) and c:IsSummonPlayer(tp)
end
function c62200831.dtcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c62200831.cfilter,1,nil,tp)
end
function c62200831.dttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x166) end
end
function c62200831.dtop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(62200831,1))
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x166)
local tc=g:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,SEQ_DECKTOP)
Duel.ConfirmDecktop(tp,1)
end
end
function c62200831.cfilter2(c,tp)
return c:IsSummonLocation(LOCATION_EXTRA) and c:IsPreviousSetCard(0x166) and c:GetReasonPlayer()==1-tp
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function c62200831.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c62200831.cfilter2,1,nil,tp)
end
function c62200831.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tg=eg:Filter(c62200831.cfilter2,nil,tp)
local def=tg:GetSum(Card.GetBaseDefense)
e:SetLabel(def)
end
function c62200831.spfilter(c,e,tp)
return c:IsCode(24639891) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c62200831.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c62200831.xyzfilter(c,e,tp,mc)
return c:IsSetCard(0x166) and mc:IsCanBeXyzMaterial(c) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c62200831.spop(e,tp,eg,ep,ev,re,r,rp)
local def=e:GetLabel()
if def==0 or def>Duel.GetLP(1-tp) then return end
Duel.PayLPCost(1-tp,def)
if Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c62200831.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(62200831,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g1=Duel.SelectMatchingCard(tp,c62200831.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c62200831.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,g1:GetFirst())
local tc=g2:GetFirst()
tc:SetMaterial(g1)
Duel.Overlay(tc,g1)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
--ナイトメア・ペイン
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,78371393)
aux.AddSetNameMonsterList(c,0x1a5)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--add to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--must attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_MUST_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(s.atkcon)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e4:SetValue(s.atklimit)
c:RegisterEffect(e4)
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e6:SetValue(1)
c:RegisterEffect(e6)
--reflect
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(s.reftg)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function s.dfilter(c,e,tp)
return c:IsFaceupEx() and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK)
end
function s.thfilter(c,code)
return (c:IsCode(78371393) or aux.IsCodeListed(c,78371393)) and c:IsAbleToHand() and not c:IsCode(id)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e,tp)
if Duel.Destroy(g,REASON_EFFECT)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetHandler():GetCode())
if #g>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function s.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1a5)
end
function s.atkcon(e)
return Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.atklimit(e,c)
return c:IsFacedown() or not c:IsSetCard(0x1a5)
end
function s.reftg(e,c)
return c:IsFaceup() and c:IsSetCard(0x1a5)
end
\ No newline at end of file
--天盃龍ファドラ
function c65326118.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(65326118,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,65326118)
e1:SetTarget(c65326118.sptg)
e1:SetOperation(c65326118.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_START)
e3:SetRange(LOCATION_MZONE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(c65326118.indtg)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(65326118,2))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_STEP_END+TIMING_BATTLE_END)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(c65326118.sccon)
e5:SetTarget(c65326118.sctg)
e5:SetOperation(c65326118.scop)
c:RegisterEffect(e5)
end
function c65326118.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsLevelBelow(4)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c65326118.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c65326118.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c65326118.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(65326118,0))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c65326118.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c65326118.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c65326118.indtg(e,c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c65326118.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c65326118.mfilter(c)
return not c:IsStatus(STATUS_SUMMONING)
end
function c65326118.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(c65326118.mfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler(),mg) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(65326118,2))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c65326118.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(c65326118.mfilter,tp,LOCATION_MZONE,0,nil)
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
end
end
--冥骸融合-メメント・フュージョン
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetCondition(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.spcfilter1(c)
return c:IsReason(REASON_EFFECT) and (c:IsType(TYPE_MONSTER) or c:IsPreviousLocation(LOCATION_MZONE))
end
function s.spcfilter2(c,tp)
return c:IsReason(REASON_EFFECT) and (c:IsType(TYPE_MONSTER) or c:IsPreviousLocation(LOCATION_MZONE))
and c:IsPreviousControler(tp)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.spcfilter1,1,nil)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.spcfilter2,1,nil,0) then
Duel.RegisterFlagEffect(0,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
if eg:IsExists(s.spcfilter2,1,nil,1) then
Duel.RegisterFlagEffect(1,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.filter1(c,e)
return c:IsSetCard(0x1a1) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function s.filter2(c,e)
return not c:IsImmuneToEffect(e)
end
function s.spfilter(c,e,tp,m,f,chkf)
return (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.exfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE)
end
function s.fcheck(tp,sg,fc)
if Duel.GetFlagEffect(tp,id)~=0 then
return sg:IsExists(Card.IsSetCard,1,nil,0x1a1)
else
return sg:IsExists(Card.IsSetCard,1,nil,0x1a1) and not sg:IsExists(s.exfilter,1,nil,tp)
end
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter2,nil,e)
local mg2=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_GRAVE,0,nil,e)
if Duel.GetFlagEffect(tp,id)~=0 then
mg1:Merge(mg2)
end
aux.FCheckAdditional=s.fcheck
local res=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
aux.FCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,LOCATION_GRAVE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter2,nil,e)
local mg2=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter1),tp,LOCATION_GRAVE,0,nil,e)
if Duel.GetFlagEffect(tp,id)~=0 then
mg1:Merge(mg2)
end
aux.FCheckAdditional=s.fcheck
local sg1=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
local mat2=mat1:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
mat1:Sub(mat2)
if #mat2>0 then
Duel.HintSelection(mat2)
end
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.SendtoDeck(mat2,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
aux.FCheckAdditional=nil
end
function s.filter(c)
return c:IsSetCard(0x1a1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
if chk==0 then return #g>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,1,nil)
if Duel.Destroy(g,REASON_EFFECT)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
--燦幻開門
function c66730191.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,66730191+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c66730191.target)
e1:SetOperation(c66730191.activate)
c:RegisterEffect(e1)
end
function c66730191.filter(c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsLevelBelow(4) and c:IsAbleToHand()
end
function c66730191.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp,nil)>0
end
function c66730191.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c66730191.filter,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(c66730191.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c66730191.activate(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
local op=0
if Duel.IsExistingMatchingCard(c66730191.filter,tp,LOCATION_DECK,0,1,nil) then
if not Duel.IsExistingMatchingCard(c66730191.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)>=1 and Duel.IsExistingMatchingCard(c66730191.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(66730191,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c66730191.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
op=1
end
end
Duel.AdjustAll()
if op==0 or Duel.IsExistingMatchingCard(c66730191.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1 and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and Duel.SelectYesNo(tp,aux.Stringid(66730191,2)) then
if op~=0 then
Duel.BreakEffect()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c66730191.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--罪宝合戦
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.tdcon)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
end
function s.desfilter(c)
return c:IsFaceupEx() and c:IsSetCard(0x19e)
end
function s.desfilter2(c,e,tp,gc1,gc2)
return c:IsCanBeEffectTarget(e) and ((c:IsControler(tp) and gc1>0) or (c:IsControler(1-tp) and gc2>0))
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local gc1=Duel.GetMatchingGroupCount(s.desfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local gc2=Duel.GetMatchingGroupCount(s.desfilter,tp,0,LOCATION_GRAVE+LOCATION_REMOVED,nil)
if chkc then return chkc:IsOnField() and chkc:IsCanBeEffectTarget(e) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(s.desfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),e,tp,gc1,gc2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Group.CreateGroup()
while true do
local g=Duel.GetMatchingGroup(s.desfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,sg,e,tp,gc1,gc2)
if g:IsContains(e:GetHandler()) then
g:RemoveCard(e:GetHandler())
end
if #g==0 then
break
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sc=g:SelectUnselect(sg,tp,#sg>0,#sg>0,1,99)
if not sc then
break
elseif g:IsContains(sc) then
g:RemoveCard(sc)
sg:AddCard(sc)
if sc:IsControler(tp) then
gc1=gc1-1
else
gc2=gc2-1
end
else
sg:RemoveCard(sc)
g:AddCard(sc)
if sc:IsControler(tp) then
gc1=gc1+1
else
gc2=gc2+1
end
end
end
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.Destroy(tg,REASON_EFFECT)
end
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp==1-tp and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) and re:IsActivated()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,2,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
\ No newline at end of file
--怒小児様
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddXyzProcedure(c,nil,1,2)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHAIN_NEGATED)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetTarget(s.ovtg)
e1:SetOperation(s.ovop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(s.atkval)
e2:SetCondition(s.effcon)
e2:SetLabel(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1)
e4:SetCondition(s.effcon)
e4:SetLabel(4)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,1))
e6:SetCategory(CATEGORY_DESTROY)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.effcon)
e6:SetCost(s.descost)
e6:SetTarget(s.destg)
e6:SetOperation(s.desop)
e6:SetLabel(8)
c:RegisterEffect(e6)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_NEGATED)
ge1:SetOperation(s.negcheck)
ge1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(ge1,0)
end
end
function s.negcheck(e,tp,eg,ep,ev,re,r,rp)
local de=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON)
if de then
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,de,0,tp,tp,0)
end
end
function s.ofilter(c,e)
return c:IsCanOverlay() and (not e or not c:IsImmuneToEffect(e))
end
function s.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(s.ofilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
end
function s.gchecktp(c,tp)
return c:GetOwner()==tp
end
function s.gcheck(g,tp)
return g:FilterCount(s.gchecktp,nil,tp)<=1 and g:FilterCount(s.gchecktp,nil,1-tp)<=1
end
function s.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.ofilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:SelectSubGroup(tp,s.gcheck,false,1,2,tp)
if sg:GetCount()>0 then
Duel.HintSelection(sg)
Duel.Overlay(c,sg)
end
end
end
end
function s.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()>=e:GetLabel()
end
function s.atkval(e,c)
return c:GetOverlayCount()*700
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,4,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,4,4,REASON_COST)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
\ No newline at end of file
--百機夜工
function c7030340.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c7030340.target)
e1:SetOperation(c7030340.activate)
c:RegisterEffect(e1)
end
function c7030340.filter1(c)
return c:IsSetCard(0x26) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c7030340.filter2(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function c7030340.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c7030340.filter2(chkc) end
if chk==0 then
return Duel.IsExistingMatchingCard(c7030340.filter1,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(c7030340.filter2,tp,LOCATION_MZONE,0,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c7030340.filter2,tp,LOCATION_MZONE,0,1,1,nil)
local rg=Duel.GetMatchingGroup(c7030340.filter1,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,rg:GetCount(),0,0)
end
function c7030340.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c7030340.filter1,tp,LOCATION_GRAVE,0,nil)
local ct=Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local tc=Duel.GetFirstTarget()
if ct>0 and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--終戒超獸-ヴァルドラス
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddXyzProcedure(c,nil,10,2,nil,nil,99)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_NEGATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.discon)
e1:SetCost(s.discost)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_START)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.descon1)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,id+o*2)
e3:SetCondition(s.descon2)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
and ep==1-tp
end
function s.discost(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 s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if Duel.NegateActivation(ev)
and g:GetCount()>0 and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT)
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
if c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)~=0 then
if re:GetHandler():IsRelateToEffect(re) and re:IsHasType(EFFECT_TYPE_ACTIVATE) then
g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD):Select(tp,1,1,re:GetHandler())
else
g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD):Select(tp,1,1,nil)
end
if #g>0 then
Duel.BreakEffect()
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
function s.descon1(e)
local c=e:GetHandler()
return c:GetOverlayCount()>0 and Duel.GetAttacker()==c
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD):Select(tp,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function s.descon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_XYZ)
end
--百鬼羅刹の大饕獣
function c71100270.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2,nil,nil,7)
c:EnableReviveLimit()
--as material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71100270,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1)
e1:SetTarget(c71100270.xmtg)
e1:SetOperation(c71100270.xmop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c71100270.reptg)
e2:SetValue(c71100270.repval)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL)
e3:SetTarget(c71100270.sptg)
e3:SetOperation(c71100270.spop)
c:RegisterEffect(e3)
end
function c71100270.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsCanOverlay()
end
function c71100270.xmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and c71100270.filter(chkc) end
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,1,2,REASON_EFFECT)
and Duel.IsExistingTarget(c71100270.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,c71100270.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
end
function c71100270.xmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.RemoveOverlayCard(tp,1,1,2,2,REASON_EFFECT)~=0
and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
tc:CancelToGrave()
Duel.Overlay(c,Group.FromCards(tc))
end
end
function c71100270.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c71100270.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c71100270.repfilter,1,nil,tp)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
return true
end
return false
end
function c71100270.repval(e,c)
return c71100270.repfilter(c,e:GetHandlerPlayer())
end
function c71100270.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c71100270.mfilter(c)
return c:IsSetCard(0xac) and c:IsType(TYPE_MONSTER) and c:IsCanOverlay()
end
function c71100270.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c71100270.mfilter),tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71100270,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=g:Select(tp,1,1,nil)
Duel.Overlay(c,mg)
end
end
end
--究極融合
function c71143015.initial_effect(c)
aux.AddCodeList(c,89631139,23995346)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,71143015+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c71143015.condition)
e1:SetTarget(c71143015.target)
e1:SetOperation(c71143015.activate)
c:RegisterEffect(e1)
end
function c71143015.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c71143015.filter0(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c71143015.filter1(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and (aux.IsMaterialListCode(c,89631139) or aux.IsMaterialListCode(c,23995346)) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=c.ultimate_fusion_check or c71143015.fcheck
local res=c:CheckFusionMaterial(m,nil,chkf)
aux.FCheckAdditional=nil
return res
end
function c71143015.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsFusionCode,1,nil,89631139) and aux.IsMaterialListCode(fc,89631139) or sg:IsExists(Card.IsFusionCode,1,nil,23995346) and aux.IsMaterialListCode(fc,23995346)
end
function c71143015.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c71143015.filter0,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e)
local res=Duel.IsExistingMatchingCard(c71143015.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c71143015.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71143015.desfilter(c)
return c:IsFusionCode(89631139,23995346) and c:IsOnField()
end
function c71143015.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c71143015.filter0),tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(c71143015.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ct=0
local spchk=0
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c71143015.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
aux.FCheckAdditional=tc.ultimate_fusion_check or c71143015.fcheck
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
ct=mat1:FilterCount(c71143015.desfilter,nil)
tc:SetMaterial(mat1)
if mat1:IsExists(Card.IsFacedown,1,nil) then
local cg=mat1:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat1:Filter(c71143015.cfilter,nil):GetCount()>0 then
local cg=mat1:Filter(c71143015.cfilter,nil)
Duel.HintSelection(cg)
end
Duel.SendtoDeck(mat1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
spchk=1
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
ct=mat2:FilterCount(c71143015.desfilter,nil)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
spchk=1
end
tc:CompleteProcedure()
end
aux.FCheckAdditional=nil
if ct>0 and spchk>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(71143015,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
function c71143015.cfilter(c)
return c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_MZONE) and c:IsFaceup())
end
--黒魔女ディアベルスター
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon rule
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(s.sprcon)
e1:SetOperation(s.sprop)
c:RegisterEffect(e1)
--set s/t
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id+o)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--revive
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,id+o*2)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(s.rvcon)
e4:SetTarget(s.rvtg)
e4:SetOperation(s.rvop)
c:RegisterEffect(e4)
end
function s.cfilter(c,tp,f)
return f(c) and Duel.GetMZoneCount(tp,c)>0
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c,tp,Card.IsAbleToGraveAsCost)
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,c,tp,Card.IsAbleToGraveAsCost)
Duel.SendtoGrave(g,REASON_COST)
end
function s.filter(c)
return c:IsSetCard(0x19e) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then Duel.SSet(tp,tc) end
end
function s.rvcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD) and c:IsPreviousControler(tp) and Duel.GetTurnPlayer()==1-tp
end
function s.rvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp,Card.IsAbleToGrave)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.rvop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,tp,Card.IsAbleToGrave)
local tc=g:GetFirst()
local c=e:GetHandler()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) and c:IsRelateToChain() then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--アーマード・エクシーズ
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.tgfilter(c)
return c:IsFaceup()
end
function s.eqfilter(c,tp)
return c:IsType(TYPE_XYZ) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ft=ft-1 end
return ft>0 and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g:GetFirst(),1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tg=Duel.GetTargetsRelateToChain()
local tc=tg:Filter(Card.IsLocation,nil,LOCATION_MZONE):GetFirst()
local ec=tg:Filter(Card.IsLocation,nil,LOCATION_GRAVE):GetFirst()
if tc and ec and ec:CheckUniqueOnField(tp) and not ec:IsForbidden() then
if not Duel.Equip(tp,ec,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetLabelObject(tc)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_SET_ATTACK)
e2:SetValue(ec:GetBaseAttack())
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_ADD_ATTRIBUTE)
e3:SetValue(ec:GetAttribute())
ec:RegisterEffect(e3)
--chain attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(s.cacon)
e4:SetTarget(s.catg)
e4:SetOperation(s.caop)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e4)
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
function s.cacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler():GetEquipTarget()
end
function s.catg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetEquipTarget()
if chk==0 then return c:IsAbleToGraveAsCost() and tc:IsChainAttackable() end
Duel.SendtoGrave(c,REASON_COST)
Duel.SetTargetCard(tc)
end
function s.caop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToBattle() or tc:IsImmuneToEffect(e) then return end
Duel.ChainAttack()
end
--PSYフレームギア・δ
function c74203495.initial_effect(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74203495.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74203495,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(c74203495.condition)
e2:SetTarget(c74203495.target)
e2:SetOperation(c74203495.operation)
c:RegisterEffect(e2)
end
function c74203495.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c74203495.condition(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsPlayerAffectedByEffect(tp,8802510))
and ep~=tp and re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c74203495.spfilter(c,e,tp)
return c:IsCode(49036338) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74203495.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c74203495.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
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 c74203495.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c74203495.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
local fid=c:GetFieldID()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(74203495,RESET_EVENT+RESETS_STANDARD,0,1,fid)
c:RegisterFlagEffect(74203495,RESET_EVENT+RESETS_STANDARD,0,1,fid)
Duel.SpecialSummonComplete()
g:AddCard(c)
g:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g)
e1:SetCondition(c74203495.rmcon)
e1:SetOperation(c74203495.rmop)
Duel.RegisterEffect(e1,tp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c74203495.rmfilter(c,fid)
return c:GetFlagEffectLabel(74203495)==fid
end
function c74203495.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c74203495.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c74203495.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c74203495.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
--PSYフレームギア・α
function c75425043.initial_effect(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c75425043.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75425043,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCondition(c75425043.condition)
e2:SetTarget(c75425043.target)
e2:SetOperation(c75425043.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c75425043.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c75425043.cfilter(c,tp)
return c:IsSummonPlayer(tp)
end
function c75425043.condition(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsPlayerAffectedByEffect(tp,8802510))
and eg:IsExists(c75425043.cfilter,1,nil,1-tp)
end
function c75425043.spfilter1(c,e,tp)
return c:IsCode(49036338) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c75425043.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c75425043.spfilter2(c,e,tp)
return c:IsCode(49036338) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c75425043.thfilter0,tp,LOCATION_DECK,0,1,c)
end
function c75425043.thfilter0(c)
return c:IsSetCard(0xc1) and not c:IsCode(75425043)
end
function c75425043.thfilter(c)
return c:IsSetCard(0xc1) and not c:IsCode(75425043) and c:IsAbleToHand()
end
function c75425043.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsPlayerAffectedByEffect(tp,8802510))
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c75425043.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c75425043.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c75425043.spfilter2),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
local fid=c:GetFieldID()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(75425043,RESET_EVENT+RESETS_STANDARD,0,1,fid)
c:RegisterFlagEffect(75425043,RESET_EVENT+RESETS_STANDARD,0,1,fid)
Duel.SpecialSummonComplete()
g:AddCard(c)
g:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g)
e1:SetCondition(c75425043.rmcon)
e1:SetOperation(c75425043.rmop)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c75425043.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g2:GetCount()>0 then
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
function c75425043.rmfilter(c,fid)
return c:GetFlagEffectLabel(75425043)==fid
end
function c75425043.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c75425043.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c75425043.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c75425043.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
--輝ける星の竜
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCondition(s.indcon)
e2:SetOperation(s.indop)
c:RegisterEffect(e2)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,0,0,0)
end
function s.spfilter(c,tuner)
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO) and c:IsSynchroSummonable(tuner)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
Duel.AdjustAll()
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup()
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
end
end
end
function s.indcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():IsRace(RACE_DRAGON)
end
function s.indop(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(id,1))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
end
\ No newline at end of file
--黒羽の旋風
function c7602800.initial_effect(c)
aux.AddCodeList(c,9012916)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(7602800,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c7602800.spcon)
e2:SetTarget(c7602800.sptg)
e2:SetOperation(c7602800.spop)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(c7602800.reptg)
e3:SetValue(c7602800.repval)
e3:SetOperation(c7602800.repop)
c:RegisterEffect(e3)
end
function c7602800.cfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsType(TYPE_SYNCHRO) and c:IsAttribute(ATTRIBUTE_DARK)
and c:IsPreviousLocation(LOCATION_EXTRA)
end
function c7602800.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:FilterCount(c7602800.cfilter,nil,tp)>0
end
function c7602800.spfilter(c,e,tp,atk)
return (c:IsSetCard(0x33) or c:IsCode(9012916)) and c:GetAttack()<atk
and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c7602800.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local _,atk=eg:Filter(c7602800.cfilter,nil,tp):GetMaxGroup(Card.GetAttack)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
and c7602800.spfilter(chkc,e,tp,atk) end
if chk==0 then return atk and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c7602800.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,atk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c7602800.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp,atk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c7602800.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 c7602800.repfilter(c,tp)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsControler(tp)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c7602800.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c7602800.repfilter,1,nil,tp)
and Duel.IsCanRemoveCounter(tp,1,0,0x10,1,REASON_EFFECT) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c7602800.repval(e,c)
return c7602800.repfilter(c,e:GetHandlerPlayer())
end
function c7602800.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.RemoveCounter(tp,1,0,0x10,1,REASON_EFFECT)
end
--シンセシス・ミュートリアス
function c79194594.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c79194594.ffilter,2,true)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(79194594,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,79194594)
e1:SetCondition(c79194594.descon)
e1:SetTarget(c79194594.destg)
e1:SetOperation(c79194594.desop)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(79194594,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,79194595)
e2:SetCondition(c79194594.immcon)
e2:SetOperation(c79194594.immop)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(79194594,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,79194596)
e3:SetCondition(c79194594.thcon)
e3:SetTarget(c79194594.thtg)
e3:SetOperation(c79194594.thop)
c:RegisterEffect(e3)
end
function c79194594.ffilter(c,fc,sub,mg,sg)
return c:IsFusionSetCard(0x157) and (not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute()))
end
function c79194594.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c79194594.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c79194594.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 c79194594.immcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function c79194594.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(c79194594.efilter)
e1:SetLabel(re:GetActiveType())
c:RegisterEffect(e1)
end
end
function c79194594.efilter(e,te)
return te:IsActiveType(e:GetLabel()) and te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function c79194594.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsSummonType(SUMMON_TYPE_FUSION)
end
function c79194594.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x157) and c:IsFaceup()
end
function c79194594.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79194594.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function c79194594.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c79194594.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
--メメント・クレニアム・バースト
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--must attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_MUST_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(s.macon)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetValue(s.atklimit)
c:RegisterEffect(e3)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e5:SetValue(1)
c:RegisterEffect(e5)
--disable
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,id+EFFECT_COUNT_CODE_CHAIN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(s.discon)
e4:SetTarget(s.distg)
e4:SetOperation(s.disop)
c:RegisterEffect(e4)
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(0x1a1)
end
function s.macon(e)
return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.atklimit(e,c)
local g=Duel.GetMatchingGroup(s.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil):GetMaxGroup(Card.GetAttack)
return not g:IsContains(c)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsCode(23288411) and c:IsAttackAbove(1000) and c:IsDefenseAbove(1000)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
if rp~=1-tp or not (re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)) then return false end
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return loc&LOCATION_MZONE>0
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackAbove(1000) and tc:IsDefenseAbove(1000))
or tc:IsImmuneToEffect(e) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-1000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
if not tc:IsHasEffect(EFFECT_REVERSE_UPDATE) then
Duel.NegateEffect(ev)
end
end
--怨邪帝ガイウス
function c87288189.initial_effect(c)
--summon with 1 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87288189,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c87288189.otcon)
e1:SetOperation(c87288189.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(87288189,1))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCondition(c87288189.condition)
e3:SetTarget(c87288189.target)
e3:SetOperation(c87288189.operation)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_MATERIAL_CHECK)
e4:SetValue(c87288189.valcheck)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
end
function c87288189.otfilter(c)
return c:IsSummonType(SUMMON_TYPE_ADVANCE)
end
function c87288189.otcon(e,c,minc)
if c==nil then return true end
local mg=Duel.GetMatchingGroup(c87288189.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
end
function c87288189.otop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c87288189.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
local sg=Duel.SelectTribute(tp,c,1,1,mg)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c87288189.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function c87288189.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return true end
local ct=1
if e:GetLabel()==1 then ct=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
end
function c87288189.operation(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 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local rg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
if tc:IsAttribute(ATTRIBUTE_DARK) then
local sg=Duel.GetMatchingGroup(Card.IsCode,tc:GetControler(),0x53,0,nil,tc:GetCode())
rg:Merge(sg)
end
tc=og:GetNext()
end
if rg:GetCount()>0 then
Duel.BreakEffect()
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
end
function c87288189.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_DARK) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
--地縛死霊ゾーマ
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,id)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCountLimit(1,id+o)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(s.damcon)
e2:SetTarget(s.damtg)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,1800,500,4,RACE_ZOMBIE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPES_EFFECT_TRAP_MONSTER,1800,500,4,RACE_ZOMBIE,ATTRIBUTE_DARK) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)
--must attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_MUST_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_MUST_ATTACK_MONSTER)
e3:SetValue(s.atklimit)
c:RegisterEffect(e3)
end
function s.atklimit(e,c)
return c==e:GetHandler()
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF and c:IsReason(REASON_BATTLE) and c:IsPreviousControler(tp)
and c==Duel.GetAttackTarget() and ((Duel.GetAttacker():IsControler(1-tp) and c:IsOnField()) or Duel.GetAttacker():IsPreviousControler(1-tp))
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local bc=e:GetHandler():GetBattleTarget()
local dam=0
if bc:IsLocation(LOCATION_MZONE) then
dam=bc:GetBaseAttack()
else
dam=bc:GetTextAttack()
end
if dam<0 then dam=0 end
dam=math.min(3000,dam*2)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--PSYフレームロード・Λ
function c8802510.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.NOT(aux.FilterBoolFunction(Card.IsLinkType,TYPE_TOKEN)),2,2)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(8802510)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(8802510,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,8802510)
e2:SetCondition(c8802510.regcon)
e2:SetOperation(c8802510.regop)
c:RegisterEffect(e2)
end
function c8802510.cfilter(c,tp)
return c:IsFaceup() and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE)
and bit.band(c:GetPreviousRaceOnField(),RACE_PSYCHO)~=0 and c:IsPreviousControler(tp) and c:IsRace(RACE_PSYCHO)
end
function c8802510.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c8802510.cfilter,1,nil,tp)
end
function c8802510.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c8802510.thcon)
e1:SetOperation(c8802510.thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c8802510.thfilter(c)
return c:IsSetCard(0xc1) and c:IsAbleToHand()
end
function c8802510.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c8802510.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function c8802510.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,8802510)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c8802510.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 c89450409.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(89450409,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,89450409+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c89450409.condition)
e1:SetTarget(c89450409.target)
e1:SetOperation(c89450409.activate)
c:RegisterEffect(e1)
end
function c89450409.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c89450409.filter(c,e,tp)
return c:IsSetCard(0x29) and (c:IsType(TYPE_TUNER) or c:IsRace(RACE_WINDBEAST)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c89450409.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c89450409.filter,tp,LOCATION_DECK,0,nil,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:CheckSubGroup(aux.gffcheck,2,2,Card.IsType,TYPE_TUNER,Card.IsRace,RACE_WINDBEAST)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c89450409.cfilter(c)
return c:IsSummonLocation(LOCATION_EXTRA)
end
function c89450409.scfilter(c,mg)
return c:IsRace(RACE_DRAGON) and c:IsSynchroSummonable(nil,mg)
end
function c89450409.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTargetRange(1,0)
e3:SetTarget(c89450409.splimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local g=Duel.GetMatchingGroup(c89450409.filter,tp,LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.gffcheck,false,2,2,Card.IsType,TYPE_TUNER,Card.IsRace,RACE_WINDBEAST)
if not sg then return end
local ca=sg:GetFirst()
local cb=sg:GetNext()
local success=false
if Duel.SpecialSummonStep(ca,0,tp,tp,false,false,POS_FACEUP) and Duel.SpecialSummonStep(cb,0,tp,tp,false,false,POS_FACEUP) then
success=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ca:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
ca:RegisterEffect(e2)
local e3=e1:Clone()
cb:RegisterEffect(e3)
local e4=e2:Clone()
cb:RegisterEffect(e4)
end
Duel.SpecialSummonComplete()
local mg=Duel.GetSynchroMaterial(tp):Filter(Card.IsSetCard,nil,0x29)
if success and Duel.IsExistingMatchingCard(c89450409.cfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c89450409.scfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
and Duel.SelectYesNo(tp,aux.Stringid(89450409,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c89450409.scfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg):GetFirst()
Duel.SynchroSummon(tp,tc,nil,mg)
end
end
function c89450409.splimit(e,c)
return not c:IsRace(RACE_DRAGON) and c:IsLocation(LOCATION_EXTRA)
end
--天斗輝巧極
function c89771220.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c89771220.target)
e1:SetOperation(c89771220.activate)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(89771220)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,89771220)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(16471775)
c:RegisterEffect(e3)
end
function c89771220.deckconfilter(c)
return c:IsCode(97148796,27693363) and c:IsFaceup()
end
function c89771220.deckcon(tp)
return Duel.IsExistingMatchingCard(c89771220.deckconfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c89771220.cfilter(c)
return c:IsCode(89264428,58793369) and c:IsAbleToRemove()
end
function c89771220.fselect(g,e,tp)
return g:GetClassCount(Card.GetCode)==2 and g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
and Duel.IsExistingMatchingCard(c89771220.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,g)
end
function c89771220.spfilter(c,e,tp,g)
return c:IsCode(33250142) and c:IsCanBeSpecialSummoned(e,0,tp,false,true)
and Duel.GetLocationCountFromEx(tp,tp,g,c)>0
end
function c89771220.target(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=LOCATION_HAND+LOCATION_ONFIELD
if c89771220.deckcon(tp) then loc=loc|LOCATION_DECK end
local g=Duel.GetMatchingGroup(c89771220.cfilter,tp,loc,0,nil)
if chk==0 then return g:CheckSubGroup(c89771220.fselect,2,2,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c89771220.activate(e,tp,eg,ep,ev,re,r,rp)
local loc=LOCATION_HAND+LOCATION_ONFIELD
if c89771220.deckcon(tp) then loc=loc|LOCATION_DECK end
local g=Duel.GetMatchingGroup(c89771220.cfilter,tp,loc,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,c89771220.fselect,false,2,2,e,tp)
if rg and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c89771220.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,true,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
end
end
end
--タイム・ディメンションホール
local s,id,o=GetID()
function s.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:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummon(tp) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=1
and Duel.IsExistingMatchingCard(Card.IsSummonableCard,tp,LOCATION_DECK,0,1,nil) end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=1) then return false end
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
Duel.DisableShuffleCheck()
if tc:IsSummonableCard() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
if Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))==1 then
Duel.MoveSequence(tc,1)
end
end
end
\ No newline at end of file
--Salamandra Fusion
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,45231177)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(s.eqlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_FUSION_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,id)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetValue(700)
c:RegisterEffect(e5)
end
function s.eqlimit(e,c)
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function s.filter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.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 s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=c:GetEquipTarget()
if chk==0 then return c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
and tg and tg:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
end
function s.ffilter(c,e,tp,qc)
return c:IsType(TYPE_FUSION) and (c:IsCode(45231177) or aux.IsCodeListed(c,45231177)) and c:CheckFusionMaterial()
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,qc,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local qc=c:GetEquipTarget()
if chk==0 then return qc and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL)
and Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,qc)
and c:GetControler()==qc:GetControler() and qc:IsType(TYPE_FUSION)
and qc:IsAbleToGrave() and c:IsAbleToGrave()
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,Group.FromCards(c,qc),2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local qc=c:GetEquipTarget()
Duel.SendtoGrave(Group.FromCards(c,qc),REASON_EFFECT)
local g=Duel.GetOperatedGroup()
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
if ct~=2 then return false end
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.ffilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
\ No newline at end of file
--天盃龍チュンドラ
function c91810826.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(91810826,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,91810826)
e1:SetCondition(c91810826.spcon)
e1:SetTarget(c91810826.sptg)
e1:SetOperation(c91810826.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(91810826,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BATTLE_START)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,91810827)
e2:SetTarget(c91810826.sptg2)
e2:SetOperation(c91810826.spop2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(91810826,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_STEP_END+TIMING_BATTLE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c91810826.sccon)
e3:SetTarget(c91810826.sctg)
e3:SetOperation(c91810826.scop)
c:RegisterEffect(e3)
end
function c91810826.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c91810826.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c91810826.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c91810826.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c91810826.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c91810826.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsLevelBelow(4) and not c:IsCode(91810826)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c91810826.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c91810826.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(91810826,1))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c91810826.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c91810826.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c91810826.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c91810826.mfilter(c)
return not c:IsStatus(STATUS_SUMMONING)
end
function c91810826.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(c91810826.mfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler(),mg) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(91810826,2))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c91810826.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local mg=Duel.GetMatchingGroup(c91810826.mfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
end
end
\ No newline at end of file
--極神聖帝オーディン
function c93483212.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c93483212.tfilter,aux.NonTuner(nil),2)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93483212,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c93483212.imop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c93483212.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(93483212,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1)
e3:SetCondition(c93483212.spcon)
e3:SetCost(c93483212.spcost)
e3:SetTarget(c93483212.sptg)
e3:SetOperation(c93483212.spop)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(93483212,2))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(c93483212.drcon)
e4:SetTarget(c93483212.drtg)
e4:SetOperation(c93483212.drop)
c:RegisterEffect(e4)
end
function c93483212.tfilter(c)
return c:IsSetCard(0x3042) or c:IsHasEffect(61777313)
end
function c93483212.imop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c93483212.imfilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c93483212.imfilter(e,re)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c93483212.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
if rp==1-tp and c:IsPreviousControler(tp) and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(pos,POS_FACEUP)~=0 then
c:RegisterFlagEffect(93483212,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c93483212.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(93483212)~=0
end
function c93483212.cfilter(c)
return c:IsSetCard(0x3042) and c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost()
end
function c93483212.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c93483212.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c93483212.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c93483212.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c93483212.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),SUMMON_VALUE_SELF,tp,tp,false,false,POS_FACEUP)
end
end
function c93483212.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function c93483212.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c93483212.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--ナイトメア・スローン
local s,id,o=GetID()
function s.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:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.thfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAttack(0) and c:IsDefense(0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if not tc:IsAbleToHand() or Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Destroy(tc,REASON_EFFECT)
elseif tc:IsAbleToHand() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
function s.cfilter(c,tp)
return c:IsSetCard(0x1a5) and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.filter(c,lv,tp)
return s.cfilter(c,tp) and (c:IsLevel(lv-1) or c:IsLevel(lv+1))
end
function s.spfilter(c,e,tp,eg)
local lv=c:GetLevel()
return c:IsSetCard(0x1a5) and c:IsFaceupEx() and c:IsAbleToHand()
and eg:IsExists(s.filter,1,nil,lv,tp)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,eg) end
e:SetLabelObject(eg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp,e:GetLabelObject())
local tc=sg:GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
end
--TG グレイヴ・ブラスター
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--material
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_SYNCHRO),aux.NonTuner(Card.IsType,TYPE_SYNCHRO),2)
--spsum condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(aux.synlimit)
c:RegisterEffect(e1)
--banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1)
e2:SetCondition(s.rmcon)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetLabelObject(e2)
e3:SetValue(s.matchk)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_CUSTOM+id)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
aux.RegisterMergedDelayedEvent(c,id,EVENT_REMOVE)
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.filter(c)
return c:IsSummonLocation(LOCATION_EXTRA) and c:IsAbleToRemove()
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end
end
function s.matchk(e,c)
local ef=e:GetLabelObject()
local ct=c:GetMaterial():FilterCount(Card.IsType,nil,TYPE_SYNCHRO)-1
if ct<0 then ct=0 end
ef:SetCountLimit(ct)
end
function s.sfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsCanBeEffectTarget(e)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=eg:Filter(s.sfilter,nil,e,tp)
if chkc then return g:IsContains(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP) end
end
--邪帝ガイウス
function c9748752.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9748752,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c9748752.condition)
e1:SetTarget(c9748752.target)
e1:SetOperation(c9748752.operation)
c:RegisterEffect(e1)
end
function c9748752.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function c9748752.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
if tc:IsFaceup() and tc:IsAttribute(ATTRIBUTE_DARK) then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
end
end
function c9748752.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
if tc:IsLocation(LOCATION_REMOVED) and tc:IsType(TYPE_MONSTER) and tc:IsAttribute(ATTRIBUTE_DARK) then
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
end
No preview for this file type
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