Commit 6723fd37 authored by fallenstardust's avatar fallenstardust

update fixed scripts

parent e72f55ab
--混沌の落とし穴
function c11593137.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c11593137.condition)
e1:SetCost(c11593137.cost)
e1:SetTarget(c11593137.target)
e1:SetOperation(c11593137.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function c11593137.filter(c)
return c:IsAttribute(0x30) and c:IsAbleToRemove()
end
function c11593137.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:IsExists(c11593137.filter,1,nil)
end
function c11593137.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c11593137.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(c11593137.filter,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c11593137.activate(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c11593137.filter,nil)
Duel.NegateSummon(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
--バーサーク・デーモン
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
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+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+id)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.atkcon)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
end
function s.cfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function s.fselect(g)
return g:IsExists(Card.IsRace,1,nil,RACE_FIEND)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local rg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and rg:CheckSubGroup(s.fselect,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=rg:SelectSubGroup(tp,s.fselect,false,2,2)
Duel.SetTargetCard(sg)
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()
local tg=Duel.GetTargetsRelateToChain()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local dt=Duel.Destroy(tg,REASON_EFFECT)
if dt>0 then
Duel.RaiseEvent(c,EVENT_CUSTOM+id,re,r,tp,ep,dt)
end
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return tp==rp and eg and eg:IsContains(e:GetHandler())
end
function s.atkfilter(c)
return c:IsFaceup() and c:GetBaseAttack()>0
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 s.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.atkfilter,tp,0,LOCATION_MZONE,ev,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.atkfilter,tp,0,LOCATION_MZONE,ev,ev,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetTargetsRelateToChain()
local atk=tg:GetSum(Card.GetBaseAttack)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(atk)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--カノプスの守護者
function c1490690.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e0)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1490690,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c1490690.con)
e1:SetTarget(c1490690.tg)
e1:SetOperation(c1490690.op)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1490690,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,1490690)
e2:SetCondition(c1490690.stcon)
e2:SetTarget(c1490690.sttg)
e2:SetOperation(c1490690.stop)
c:RegisterEffect(e2)
end
function c1490690.con(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function c1490690.filter(c,e,tp)
return c:IsSetCard(0x19d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c1490690.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1490690.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c1490690.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c1490690.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
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(c1490690.splimit)
e1:SetLabel(g:GetFirst():GetOriginalCodeRule())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c1490690.splimit(e,c,sump,sumtype,sumpos,targetp,se)
local sc=se:GetHandler()
return sc and sc:IsCode(1490690) and c:IsOriginalCodeRule(e:GetLabel())
end
function c1490690.stcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD)
end
function c1490690.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c1490690.stop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
--昇天の剛角笛
function c1637760.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(c1637760.condition)
e1:SetTarget(c1637760.target)
e1:SetOperation(c1637760.activate)
c:RegisterEffect(e1)
end
function c1637760.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and Duel.GetTurnPlayer()~=tp and rp==1-tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c1637760.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(1-tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c1637760.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
Duel.BreakEffect()
Duel.Draw(1-tp,1,REASON_EFFECT)
Duel.BreakEffect()
Duel.SkipPhase(1-tp,Duel.GetCurrentPhase(),RESET_PHASE+PHASE_END,1)
end
--アロマリリス-ロザリーナ
local s,id,o=GetID()
function c24689197.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.retg)
e1:SetOperation(s.recop)
c:RegisterEffect(e1)
--spsummon
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:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(0xc9) and c:GetAttack()>0
end
function s.retg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) 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)
local tc=Duel.GetFirstTarget()
local rec=math.ceil(tc:GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local rec=math.ceil(tc:GetAttack()/2)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Recover(tp,rec,REASON_EFFECT) end
end
--spsummon
function s.spfilter(c,e,tp)
return c:IsSetCard(0xc9) and not c:IsType(TYPE_TUNER) 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)
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) end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(1,0)
e2:SetTarget(s.splimit)
Duel.RegisterEffect(e2,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_PLANT)
end
\ No newline at end of file
--トイ・ボックス
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)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetTarget(s.sttg)
e2:SetOperation(s.stop)
c:RegisterEffect(e2)
--destroy facedown
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(id,1))
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
--destroy monster
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(s.dmcon)
e4:SetCost(s.dmcost)
e4:SetTarget(s.dmtg)
e4:SetOperation(s.dmop)
c:RegisterEffect(e4)
end
function s.stfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1a8) and c:IsSSetable()
and c.set_as_spell and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup())
end
function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.stfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
end
function s.stop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local ct=math.min(Duel.GetLocationCount(tp,LOCATION_SZONE),2)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.stfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_MZONE+LOCATION_GRAVE,0,1,ct,nil)
Duel.SSet(tp,g)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_SZONE,0,nil)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_SZONE,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,2,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function s.dmcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function s.cfilter(c,tp)
return c:IsFacedown() and c:IsAbleToGraveAsCost()
end
function s.dmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function s.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ac=Duel.GetAttacker()
if chk==0 then return ac:IsOnField() end
Duel.SetTargetCard(ac)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,ac,1,0,0)
end
function s.dmop(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetFirstTarget()
if ac:IsRelateToEffect(e) and ac:IsControler(1-tp) and ac:IsType(TYPE_MONSTER) then
Duel.Destroy(ac,REASON_EFFECT)
end
end
\ No newline at end of file
--Ken the Warrior Dragon
local s,id,o=GetID()
function s.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--draw and discard
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.discon)
e3:SetTarget(s.distg)
e3:SetOperation(s.disop)
c:RegisterEffect(e3)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function 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)
end
end
function s.spfilter(c,e,tp)
return c:IsCode(52126602) 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(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE,0,0)
Duel.SpecialSummonComplete()
end
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(52126602)>0
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,2)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(1-tp,2,REASON_EFFECT)>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DISCARD)
Duel.DiscardHand(1-tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
\ No newline at end of file
--RR-ブルーム・ヴァルチャー
local s,id,o=GetID()
function s.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(s.spcost)
e2:SetCondition(s.spcon2)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK)
end
function s.cfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_WINDBEAST)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsAttribute(ATTRIBUTE_DARK)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0xba) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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)>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,c,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) 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,s.spfilter,tp,LOCATION_HAND,0,1,1,c,e,tp)
if g:GetCount()>0 then
g:AddCard(c)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function s.spfilter2(c,e,tp)
return c:IsSetCard(0xba) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg2(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.spfilter2(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 c:IsLevelBelow(4)
and c:IsCanBeEffectTarget(e) and Duel.IsExistingTarget(s.spfilter2,tp,LOCATION_GRAVE,0,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter2,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
g:AddCard(c)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,LOCATION_GRAVE)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local c=e:GetHandler()
local tg=Duel.GetTargetsRelateToChain()
if tg:GetCount()>0 then
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--マジェスペクター・テンペスト
function c2572890.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(c2572890.condition1)
e1:SetCost(c2572890.cost)
e1:SetTarget(c2572890.target1)
e1:SetOperation(c2572890.activate1)
c:RegisterEffect(e1)
--Activate(effect)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c2572890.condition2)
e2:SetCost(c2572890.cost)
e2:SetTarget(c2572890.target2)
e2:SetOperation(c2572890.activate2)
c:RegisterEffect(e2)
end
function c2572890.cfilter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_WIND)
and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c2572890.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,c2572890.cfilter,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,c2572890.cfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c2572890.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c2572890.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c2572890.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c2572890.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c2572890.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c2572890.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--ダイノルフィア・リヴァージョン
--not fully implemented
function c28292031.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(28292031,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,28292031+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c28292031.condition)
e1:SetCost(c28292031.cost)
e1:SetTarget(c28292031.target(EVENT_CHAINING))
e1:SetOperation(c28292031.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_BATTLE_END,TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetTarget(c28292031.target(EVENT_FREE_CHAIN))
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SUMMON)
e3:SetTarget(c28292031.target(EVENT_SUMMON))
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EVENT_FLIP_SUMMON)
e4:SetTarget(c28292031.target(EVENT_FLIP_SUMMON))
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EVENT_SPSUMMON)
e5:SetTarget(c28292031.target(EVENT_SPSUMMON))
c:RegisterEffect(e5)
local e6=e1:Clone()
e6:SetCode(EVENT_TO_HAND)
e6:SetTarget(c28292031.target(EVENT_TO_HAND))
c:RegisterEffect(e6)
local e7=e1:Clone()
e7:SetCode(EVENT_ATTACK_ANNOUNCE)
e7:SetTarget(c28292031.target(EVENT_ATTACK_ANNOUNCE))
c:RegisterEffect(e7)
--negate damage
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e0:SetRange(LOCATION_GRAVE)
e0:SetCondition(c28292031.damcon)
e0:SetCost(aux.bfgcost)
e0:SetOperation(c28292031.damop)
c:RegisterEffect(e0)
end
function c28292031.cfilter(c)
return c:IsSetCard(0x173) and c:IsType(TYPE_FUSION) and c:IsFaceup()
end
function c28292031.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c28292031.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c28292031.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c28292031.filter(c,event)
if not (c:GetType()==TYPE_TRAP+TYPE_COUNTER and c:IsAbleToRemoveAsCost()) then return false end
local te=c:CheckActivateEffect(false,true,false)
return te and te:GetCode()==event
end
function c28292031.target(event)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c28292031.filter,tp,LOCATION_GRAVE,0,1,nil,event)
end
e:SetLabel(0)
local _GetCurrentChain=Duel.GetCurrentChain
Duel.GetCurrentChain=function() return _GetCurrentChain()-1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c28292031.filter,tp,LOCATION_GRAVE,0,1,1,nil,event)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.GetCurrentChain=_GetCurrentChain
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
end
function c28292031.operation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
function c28292031.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=2000 and Duel.GetBattleDamage(tp)>0
end
function c28292031.damop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
--方舟の選別
function c30888983.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c30888983.condition)
e1:SetCost(c30888983.cost)
e1:SetTarget(c30888983.target)
e1:SetOperation(c30888983.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function c30888983.cfilter(c,rc)
return c:IsFaceup() and c:IsRace(rc)
end
function c30888983.filter(c)
return Duel.IsExistingMatchingCard(c30888983.cfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,c:GetRace())
end
function c30888983.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:IsExists(c30888983.filter,1,nil)
end
function c30888983.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c30888983.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(c30888983.filter,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c30888983.activate(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c30888983.filter,nil)
Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT)
end
--暗黒界の懲罰
local s,id,o=GetID()
function s.initial_effect(c)
--Negate Normal Summon or Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCountLimit(1,id)
e1:SetCondition(s.descon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e2)
--Destroy Replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,id+o)
e3:SetTarget(s.reptg)
e3:SetValue(s.repval)
e3:SetOperation(s.repop)
c:RegisterEffect(e3)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function s.tgfilter(c)
return c:IsRace(RACE_FIEND) and c:IsDiscardable(REASON_EFFECT)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,tp,1)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
if Duel.Destroy(eg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
end
end
function s.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x6) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
and not c:IsReason(REASON_REPLACE) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function s.repval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--ライト・バニッシュ
function c32233746.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c32233746.condition)
e1:SetCost(c32233746.cost)
e1:SetTarget(c32233746.target)
e1:SetOperation(c32233746.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function c32233746.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c32233746.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,nil,0x38) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,1,nil,0x38)
Duel.Release(g,REASON_COST)
end
function c32233746.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c32233746.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
--マジェスペクター・ドラコ
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.srcon)
e1:SetTarget(s.srtg)
e1:SetOperation(s.srop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(2,id+o)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--pendulum
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.pencon)
e3:SetTarget(s.pentg)
e3:SetOperation(s.penop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_RELEASE)
c:RegisterEffect(e4)
end
s.pendulum_level=4
function s.cfilter(c)
return c:IsSetCard(0xc7,0xd0)
end
function s.srcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function s.srfilter(c,oc)
return c:IsSetCard(0xd0) and c:IsAbleToHand()
end
function s.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,s.srfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand(tp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.BreakEffect()
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
function s.cfilter2(c)
return (c:IsType(TYPE_MONSTER) and not c:IsPreviousLocation(LOCATION_SZONE)) or c:IsPreviousLocation(LOCATION_MZONE)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter2,1,nil) and not eg:IsContains(e:GetHandler())
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsLevelBelow(6) and c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_WIND)
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,0,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)
end
end
function s.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--セベクの魔導士
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--material
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_EFFECT),2,2)
--recover
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.reccon1)
e1:SetTarget(s.rectg)
e1:SetOperation(s.recop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(s.reccon2)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_RECOVER)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.damcon)
e3:SetTarget(s.damtg)
e3:SetOperation(s.damop)
c:RegisterEffect(e3)
end
--recover
function s.recfilter(c,lg)
return lg:IsContains(c)
end
function s.reccon1(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return ep~=tp and eg:IsExists(s.recfilter,1,nil,lg)
end
function s.reccon2(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--damage
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp or 1-tp
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp and 1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,1000)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,1000,REASON_EFFECT,true)
Duel.Damage(tp,1000,REASON_EFFECT,true)
Duel.RDComplete()
end
--神の通告
function c40605147.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c40605147.condition)
e1:SetCost(c40605147.cost)
e1:SetTarget(c40605147.target)
e1:SetOperation(c40605147.activate)
c:RegisterEffect(e1)
--Activate(summon)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_SPSUMMON)
e2:SetCondition(c40605147.condition1)
e2:SetCost(c40605147.cost)
e2:SetTarget(c40605147.target1)
e2:SetOperation(c40605147.activate1)
c:RegisterEffect(e2)
end
function c40605147.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c40605147.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1500) end
Duel.PayLPCost(tp,1500)
end
function c40605147.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c40605147.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c40605147.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c40605147.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c40605147.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
--神の宣告
function c41420027.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c41420027.condition1)
e1:SetCost(c41420027.cost1)
e1:SetTarget(c41420027.target1)
e1:SetOperation(c41420027.activate1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
--Activate(effect)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_CHAINING)
e4:SetCondition(c41420027.condition2)
e4:SetCost(c41420027.cost2)
e4:SetTarget(c41420027.target2)
e4:SetOperation(c41420027.activate2)
c:RegisterEffect(e4)
end
function c41420027.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c41420027.cost1(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 c41420027.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c41420027.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c41420027.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c41420027.cost2(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 c41420027.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c41420027.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--ヴァルモニカ・ヴェルサーレ
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_DAMAGE+CATEGORY_TOGRAVE)
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)
end
function s.filter(c)
return c:IsSetCard(0x1a3) and c:IsAbleToGrave() and not c:IsCode(id)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp,op)
if op==nil then
local p=Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0x1a3) and tp or 1-tp
op=aux.SelectFromOptions(p,{true,aux.Stringid(id,1)},{true,aux.Stringid(id,2)})
end
if op==1 then
if Duel.Recover(tp,500,REASON_EFFECT)<1
or not Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil)
or not Duel.SelectYesNo(tp,aux.Stringid(id,3)) then return end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_DECK,0,nil,0x1a3)
local dct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local seq=-1
local hc
for tc in aux.Next(g) do
local sq=tc:GetSequence()
if sq>seq then
seq=sq
hc=tc
end
end
Duel.BreakEffect()
if seq>-1 then
Duel.ConfirmDecktop(tp,dct-seq)
Duel.DisableShuffleCheck()
if hc:IsAbleToHand() then
Duel.SendtoHand(hc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hc)
Duel.ShuffleHand(tp)
else
Duel.SendtoGrave(hc,REASON_RULE)
end
else
Duel.ConfirmDecktop(tp,dct)
end
if dct-seq>1 then Duel.ShuffleDeck(tp) end
elseif Duel.Damage(tp,500,REASON_EFFECT)>0 then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.BreakEffect()
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
--ディーヴジャン
function c42427230.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42427230,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,42427230)
e1:SetCost(c42427230.spcost)
e1:SetTarget(c42427230.sptg)
e1:SetOperation(c42427230.spop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(42427230,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,42427231)
e2:SetTarget(c42427230.destg)
e2:SetOperation(c42427230.desop)
c:RegisterEffect(e2)
end
function c42427230.cfilter(c,tp)
return (c:IsControler(tp) or c:IsFaceup()) and c:IsCode(42427230) and c:IsReleasable()
end
function c42427230.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local rg=Duel.GetMatchingGroup(c42427230.cfilter,tp,LOCATION_MZONE,0,nil,tp)
if chk==0 then return rg:GetCount()==Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_MZONE,0,nil,42427230):GetCount() and rg:GetCount()~=0 and Duel.GetMZoneCount(tp,rg)>0 end
local ct=Duel.Release(rg,REASON_COST)*2
e:SetLabel(ct)
end
function c42427230.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,42427231,0,TYPES_TOKEN_MONSTER,200,200,1,RACE_MACHINE,ATTRIBUTE_FIRE) end
local ct=e:GetLabel()
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c42427230.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=e:GetLabel()
if ft>0 and ct>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,42427231,0,TYPES_TOKEN_MONSTER,200,200,1,RACE_MACHINE,ATTRIBUTE_FIRE) then
local count=math.min(ft,ct)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then count=1 end
if count>1 then
local num={}
local i=1
while i<=count do
num[i]=i
i=i+1
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(42427230,2))
count=Duel.AnnounceNumber(tp,table.unpack(num))
end
for i=1,count do
local token=Duel.CreateToken(tp,42427231)
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(42427230,3))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetLabel(tp)
e1:SetOperation(c42427230.damop)
token:RegisterEffect(e1,true)
end
end
Duel.SpecialSummonComplete()
end
end
function c42427230.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetLabel()
if c:IsReason(REASON_DESTROY) then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
e:Reset()
end
function c42427230.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TOKEN)
end
function c42427230.desfilter2(c,e)
return c42427230.desfilter(c) and c:IsCanBeEffectTarget(e)
end
function c42427230.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c42427230.desfilter(chkc) end
local g=Duel.GetMatchingGroup(c42427230.desfilter2,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return g:GetCount()~=0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,g:GetCount(),nil)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c42427230.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--キックバック
function c43340443.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c43340443.condition)
e1:SetTarget(c43340443.target)
e1:SetOperation(c43340443.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
end
function c43340443.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c43340443.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,1,0,0)
end
function c43340443.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
Duel.SendtoHand(eg,nil,REASON_EFFECT)
end
--セイバー・ホール
function c44901281.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c44901281.condition)
e1:SetTarget(c44901281.target)
e1:SetOperation(c44901281.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function c44901281.filter(c)
return c:IsFaceup() and c:IsSetCard(0x100d)
end
function c44901281.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c44901281.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetCurrentChain()==0
end
function c44901281.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c44901281.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
--嗤う黒山羊
local s,id,o=GetID()
function s.initial_effect(c)
--Activate & sumlimit
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ANNOUNCE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ANNOUNCE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.target)
e2:SetOperation(s.alop)
c:RegisterEffect(e2)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_MONSTER,OPCODE_ISTYPE}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetLabel(ac)
e1:SetTargetRange(1,1)
e1:SetTarget(s.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsOriginalCodeRule(e:GetLabel()) and not c:IsLocation(LOCATION_GRAVE)
end
function s.alop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetLabel(ac)
e1:SetTargetRange(1,1)
e1:SetValue(s.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.actlimit(e,re,tp)
local rc=re:GetHandler()
return rc:IsOriginalCodeRule(e:GetLabel()) and (rc:IsOnField() or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
\ No newline at end of file
--昇天の黒角笛
function c50323155.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(c50323155.condition)
e1:SetTarget(c50323155.target)
e1:SetOperation(c50323155.activate)
c:RegisterEffect(e1)
end
function c50323155.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and eg:GetCount()==1 and Duel.GetCurrentChain()==0
end
function c50323155.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c50323155.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
--粛声の竜賢姫サフィラ
local s,id,o=GetID()
function s.initial_effect(c)
--to grave search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.tscost)
e1:SetTarget(s.tstg)
e1:SetOperation(s.tsop)
c:RegisterEffect(e1)
--Ritual Summon
local e2=aux.AddRitualProcGreater2(c,s.filter,LOCATION_HAND,nil,nil,true)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetCost(aux.bfgcost)
c:RegisterEffect(e2)
end
function s.tscost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.tsfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToGrave()
end
function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tsfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.thfilter(c)
return c:IsRace(RACE_DRAGON+RACE_WARRIOR) and c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
end
function s.tsop(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tsfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_GRAVE)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function s.filter(c,e,tp,chk)
return c:IsRace(RACE_DRAGON+RACE_WARRIOR) and c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and (not chk or c~=e:GetHandler())
end
\ No newline at end of file
--Gen the Diamond Tiger
local s,id,o=GetID()
function s.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--draw and discard
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.discon)
e3:SetTarget(s.distg)
e3:SetOperation(s.disop)
c:RegisterEffect(e3)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function 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)
end
end
function s.spfilter(c,e,tp)
return c:IsCode(25131968) 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(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE,0,0)
Duel.SpecialSummonComplete()
end
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(25131968)>0
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)
end
\ No newline at end of file
--エレキャンセル
function c56993276.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c56993276.condition)
e1:SetCost(c56993276.cost)
e1:SetTarget(c56993276.target)
e1:SetOperation(c56993276.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e2)
end
function c56993276.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function c56993276.cfilter(c)
return c:IsSetCard(0xe) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function c56993276.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(c56993276.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c56993276.cfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c56993276.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(Card.IsControler,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c56993276.activate(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(Card.IsControler,nil,1-tp)
Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT)
end
--パラドックス・フュージョン
function c57355219.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(c57355219.condition1)
e1:SetCost(c57355219.cost)
e1:SetTarget(c57355219.target1)
e1:SetOperation(c57355219.activate1)
c:RegisterEffect(e1)
--Activate(effect)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c57355219.condition2)
e2:SetCost(c57355219.cost)
e2:SetTarget(c57355219.target2)
e2:SetOperation(c57355219.activate2)
c:RegisterEffect(e2)
end
function c57355219.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c57355219.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsAbleToRemoveAsCost() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c57355219.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c57355219.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c57355219.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,0,REASON_COST+REASON_TEMPORARY)
e:SetLabelObject(g:GetFirst())
end
function c57355219.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c57355219.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
c57355219.retreg(e,tp)
end
function c57355219.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c57355219.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c57355219.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
c57355219.retreg(e,tp)
end
function c57355219.retreg(e,tp)
local tc=e:GetLabelObject()
e:SetLabelObject(nil)
if not tc then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetCondition(c57355219.retcon)
e1:SetOperation(c57355219.retop)
tc:SetTurnCounter(0)
Duel.RegisterEffect(e1,tp)
end
function c57355219.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c57355219.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local ct=c:GetTurnCounter()
c:SetTurnCounter(ct+1)
if ct==1 then
Duel.ReturnToField(c,POS_FACEUP_ATTACK)
end
end
--ブローニング・パワー
function c59718521.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c59718521.condition1)
e1:SetCost(c59718521.cost)
e1:SetTarget(c59718521.target1)
e1:SetOperation(c59718521.activate1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e2)
--Activate(effect)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_CHAINING)
e3:SetCondition(c59718521.condition2)
e3:SetCost(c59718521.cost)
e3:SetTarget(c59718521.target2)
e3:SetOperation(c59718521.activate2)
c:RegisterEffect(e3)
end
function c59718521.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c59718521.filter(c)
return c:IsRace(RACE_PSYCHO) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c59718521.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,c59718521.filter,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,c59718521.filter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c59718521.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c59718521.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c59718521.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c59718521.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c59718521.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--熾動する煉獄
local s,id,o=GetID()
function s.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(s.tgcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.tgtg)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
end
function s.costfilter(c)
return (c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER)) or (c:IsSetCard(0xc5) and c:IsType(TYPE_SPELL+TYPE_TRAP)) and not c:IsPublic()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local h=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if e:GetHandler():IsLocation(LOCATION_HAND) then h=h-1 end
return h>0 and Duel.IsPlayerCanDraw(tp,h)
end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local ct=Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
Duel.BreakEffect()
Duel.Draw(tp,ct,REASON_EFFECT)
end
function s.cfilter(c)
return c:IsFacedown() or not c:IsRace(RACE_FIEND)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil))
and (Duel.GetTurnCount()~=e:GetHandler():GetTurnID() or e:GetHandler():IsReason(REASON_RETURN))
end
function s.tgfilter(c,e)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsCanBeEffectTarget(e) and c:IsFaceup()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local tg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_REMOVED,0,nil,e)
if chk==0 then return #tg>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
aux.GCheckAdditional=aux.dncheck
local g=tg:SelectSubGroup(tp,aux.TRUE,false,1,11)
aux.GCheckAdditional=nil
Duel.SetTargetCard(g)
if g then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
end
function s.tgop(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.SendtoGrave(tg,REASON_EFFECT+REASON_RETURN)
end
end
--VS 裏螺旋流雪風
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_DAMAGE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
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.cfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_EARTH+ATTRIBUTE_FIRE) and not c:IsPublic()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_HAND,0,nil)
if chk==0 then return #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,aux.dabcheck,false,1,3)
Duel.ConfirmCards(1-tp,sg)
Duel.RaiseEvent(sg,EVENT_CUSTOM+9091064,e,REASON_COST,tp,tp,0)
Duel.ShuffleHand(tp)
e:SetLabel(#sg)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked() end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,400)
end
function s.sfilter(c,e,tp)
return c:IsSetCard(0x195) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
if ct>0 and Duel.Damage(1-tp,400,REASON_EFFECT)>0 and Duel.GetLP(1-tp)>0 then
local g=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_HAND,0,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
if ct>1 then
Duel.BreakEffect()
Duel.Damage(1-tp,600,REASON_EFFECT)
if Duel.GetLP(1-tp)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x195))
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
end
if ct>2 then
Duel.BreakEffect()
if Duel.Damage(1-tp,800,REASON_EFFECT)>0 and Duel.GetLP(1-tp)>0 then
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
--夢魔鏡の夢占い
function c61459246.initial_effect(c)
aux.AddCodeList(c,74665651,1050355)
--activate(effect)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,61459246+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c61459246.condition1)
e1:SetTarget(c61459246.target1)
e1:SetOperation(c61459246.activate1)
c:RegisterEffect(e1)
--activate(spsummon)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_SPSUMMON)
e2:SetCountLimit(1,61459246+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c61459246.condition2)
e2:SetTarget(c61459246.target2)
e2:SetOperation(c61459246.activate2)
c:RegisterEffect(e2)
end
function c61459246.condition1(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and rp==1-tp and Duel.IsEnvironment(74665651,PLAYER_ALL,LOCATION_FZONE)
end
function c61459246.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c61459246.activate1(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c61459246.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and rp==1-tp and Duel.IsEnvironment(1050355,PLAYER_ALL,LOCATION_FZONE)
end
function c61459246.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c61459246.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
--A・O・G リターンゼロ
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.ngcon)
e1:SetCost(s.ngcost)
e1:SetTarget(s.ngtg)
e1:SetOperation(s.ngop)
c:RegisterEffect(e1)
--back deck and destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
function s.cfilter(c,att)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(att)
end
function s.ngcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function s.ngcost(e,tp,eg,ep,ev,re,r,rp,chk)
local att=re:GetHandler():GetAttribute()
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil,att) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,att)
e:SetLabel(g:GetFirst():GetAttribute())
Duel.Remove(g,POS_FACEUP,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetTargetRange(1,0)
e1:SetTarget(s.rmlimit)
e1:SetLabel(e:GetLabel())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.ngtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.ngop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function s.rmlimit(e,c,tp,r,re)
return c:IsAttribute(e:GetLabel()) and re and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsCode(id) and r==REASON_COST
end
function s.tdfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x2) and c:IsAbleToDeck()
end
function s.desfilter(c)
return c:GetSequence()<5
end
function s.tdtg(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.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local sg=g:SelectSubGroup(tp,aux.dabcheck,false,1,6)
Duel.SetTargetCard(sg)
if sg then
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=tg:GetCount()
local dg=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil)
if ct>0 and dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg2=dg:Select(tp,1,ct,nil)
Duel.Destroy(sg2,REASON_EFFECT)
end
end
\ No newline at end of file
--イリュージョン・バルーン
function c62161698.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62161698,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c62161698.condition)
e1:SetTarget(c62161698.target)
e1:SetOperation(c62161698.operation)
c:RegisterEffect(e1)
if not c62161698.global_check then
c62161698.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(c62161698.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c62161698.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if tc:IsPreviousLocation(LOCATION_MZONE) then
if tc:IsPreviousControler(0) then p1=true else p2=true end
end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,62161698,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,62161698,RESET_PHASE+PHASE_END,0,1) end
end
function c62161698.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,62161698)~=0
end
function c62161698.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummon(tp)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c62161698.filter(c,e,tp)
return c:IsSetCard(0x9f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c62161698.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c62161698.filter,nil,e,tp)
if g:GetCount()>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(62161698,1)) 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_FACEUP)
end
Duel.ShuffleDeck(tp)
end
--憑依連携
function c65046521.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(65046521,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,65046521)
e1:SetTarget(c65046521.target)
e1:SetOperation(c65046521.activate)
c:RegisterEffect(e1)
--to field
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(65046521,2))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,65046521)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c65046521.tftg)
e2:SetOperation(c65046521.tfop)
c:RegisterEffect(e2)
end
function c65046521.filter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsDefense(1500) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
end
function c65046521.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c65046521.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c65046521.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c65046521.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)~=0 and tc:IsFacedown() then Duel.ConfirmCards(1-tp,tc) end
end
local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if aux.GetAttributeCount(mg)>=2 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(65046521,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
function c65046521.tffilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xc0) and not c:IsForbidden()
end
function c65046521.tftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c65046521.tffilter(chkc) and chkc:IsControler(tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c65046521.tffilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectTarget(tp,c65046521.tffilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c65046521.tfop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
--ペンデュラム・ホール
function c68477598.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(c68477598.condition)
e1:SetTarget(c68477598.target)
e1:SetOperation(c68477598.activate)
c:RegisterEffect(e1)
end
function c68477598.cfilter(c)
return c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c68477598.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:IsExists(c68477598.cfilter,1,nil)
end
function c68477598.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,eg:GetCount(),0,0)
end
function c68477598.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.SendtoDeck(eg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
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)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(s.descost)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(s.filter))
e3:SetValue(s.val)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCountLimit(1)
e4:SetCondition(s.negcon)
e4:SetOperation(s.negop)
c:RegisterEffect(e4)
end
function s.cfilter(c)
return (c:IsSetCard(0xc2) or c:IsLevel(7,8) and c:IsRace(RACE_DRAGON))
and c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function s.destg(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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,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:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_MONSTER) and c:IsLevelAbove(7)
end
function s.val(e,c)
return Duel.GetMatchingGroupCount(s.filter,e:GetHandlerPlayer(),LOCATION_REMOVED,0,nil)*400
end
function s.negfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_MONSTER)
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.IsExistingMatchingCard(s.negfilter,tp,LOCATION_REMOVED,0,1,nil)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
\ No newline at end of file
--RR-ライジング・リベリオン・ファルコン
local s,id,o=GetID()
function s.initial_effect(c)
--Xyz Summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WINDBEAST),13,5)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(s.efilter)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
--copy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(s.copycost)
e3:SetTarget(s.copytg)
e3:SetOperation(s.copyop)
c:RegisterEffect(e3)
end
function s.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function s.damval1(c)
if c:GetLocation()~=LOCATION_MZONE then return end
return math.max(0,c:GetTextAttack())
end
function s.damval2(c)
if c:GetPreviousLocation()~=LOCATION_MZONE then return end
return math.max(0,c:GetTextAttack())
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
local atk=g:GetSum(s.damval1)
if atk>0 then Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if Duel.Destroy(g,REASON_EFFECT)>0 and e:GetHandler():GetOverlayGroup():Filter(Card.IsType,nil,TYPE_XYZ):GetClassCount(Card.GetCode)>=3 then
local dg=Duel.GetOperatedGroup()
local atk=dg:GetSum(s.damval2)
if atk>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
function s.filter(c)
return c:IsSetCard(0xba) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_XYZ) and not c:IsForbidden()
end
function s.copycost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(id)==0 and c:CheckRemoveOverlayCard(tp,3,REASON_COST) end
c:RemoveOverlayCard(tp,3,3,REASON_COST)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function s.copytg(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) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil)
end
function s.copyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
local code=tc:GetOriginalCode()
local cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1)
end
end
\ No newline at end of file
--エニグマスター・パックビット
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(s.sumcon)
e1:SetTarget(s.mvtg)
e1:SetOperation(s.mvop)
c:RegisterEffect(e1)
--mobe(to grave)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND)
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)
e2:SetTarget(s.mvtg)
e2:SetOperation(s.mvop)
c:RegisterEffect(e2)
--spsummon spell
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.spcon)
e3:SetTarget(s.spstg)
e3:SetOperation(s.spsop)
c:RegisterEffect(e3)
end
--move
function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.filter(c,tp)
local r=LOCATION_REASON_TOFIELD
if not c:IsControler(c:GetOwner()) then r=LOCATION_REASON_CONTROL end
return (c:IsType(TYPE_MONSTER) or c:IsLocation(LOCATION_MZONE)) and c:IsFaceupEx()
and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0
end
function s.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and s.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,LOCATION_MZONE,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,LOCATION_MZONE,1,1,nil)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
end
function s.mvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)~=1 then return false end
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(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
--special
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS
end
function s.sfilter(c,e,tp)
return c:IsLocation(LOCATION_SZONE) and c:GetOriginalType()&TYPE_MONSTER>0
and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_SZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spsop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--ふわんだりぃずと怖い海
function c77610503.initial_effect(c)
--Activate(Special Summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCountLimit(1,77610503+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c77610503.discon)
e1:SetTarget(c77610503.distg)
e1:SetOperation(c77610503.disop)
c:RegisterEffect(e1)
end
function c77610503.cfilter1(c)
return c:IsSummonType(SUMMON_TYPE_ADVANCE) and c:IsFaceup() and not c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c77610503.cfilter2(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c77610503.discon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
and Duel.IsExistingMatchingCard(c77610503.cfilter1,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(c77610503.cfilter2,tp,LOCATION_MZONE,0,1,nil)
end
function c77610503.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,eg:GetCount(),0,0)
end
function c77610503.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.SendtoHand(eg,nil,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e2:SetValue(3)
Duel.RegisterEffect(e2,tp)
end
--重力崩壊
function c7811875.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c7811875.condition)
e1:SetCost(c7811875.cost)
e1:SetTarget(c7811875.target)
e1:SetOperation(c7811875.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function c7811875.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function c7811875.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToGraveAsCost()
end
function c7811875.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c7811875.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c7811875.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c7811875.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(Card.IsControler,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c7811875.activate(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(Card.IsControler,nil,1-tp)
Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(0,1)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
Duel.RegisterEffect(e3,tp)
end
--王者の看破
function c82382815.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c82382815.condition1)
e1:SetTarget(c82382815.target1)
e1:SetOperation(c82382815.activate1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
--Activate(effect)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_CHAINING)
e4:SetCondition(c82382815.condition2)
e4:SetTarget(c82382815.target2)
e4:SetOperation(c82382815.activate2)
c:RegisterEffect(e4)
end
function c82382815.cfilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsType(TYPE_NORMAL)
end
function c82382815.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and Duel.IsExistingMatchingCard(c82382815.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c82382815.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c82382815.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c82382815.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(c82382815.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c82382815.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c82382815.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--神の警告
function c84749824.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c84749824.condition1)
e1:SetCost(c84749824.cost1)
e1:SetTarget(c84749824.target1)
e1:SetOperation(c84749824.activate1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
--Activate(effect)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_CHAINING)
e4:SetCondition(c84749824.condition2)
e4:SetCost(c84749824.cost2)
e4:SetTarget(c84749824.target2)
e4:SetOperation(c84749824.activate2)
c:RegisterEffect(e4)
end
function c84749824.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c84749824.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000)
else Duel.PayLPCost(tp,2000) end
end
function c84749824.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c84749824.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c84749824.condition2(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsChainNegatable(ev) then return false end
if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
return re:IsHasCategory(CATEGORY_SPECIAL_SUMMON)
end
function c84749824.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000)
else Duel.PayLPCost(tp,2000) end
end
function c84749824.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c84749824.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--ドライトロン流星群
function c84965420.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCountLimit(1,84965420+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c84965420.condition)
e1:SetTarget(c84965420.target)
e1:SetOperation(c84965420.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e2)
end
function c84965420.filter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end
function c84965420.cfilter(c,tp)
return c:IsSummonPlayer(1-tp) and c:IsAbleToDeck()
end
function c84965420.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c84965420.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetCurrentChain()==0 and eg:IsExists(c84965420.cfilter,1,nil,tp)
end
function c84965420.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,eg:GetCount(),0,0)
end
function c84965420.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.SendtoDeck(eg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
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)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCondition(s.fucon)
e3:SetCost(s.fucost)
e3:SetTarget(s.futg)
e3:SetOperation(s.fuop)
c:RegisterEffect(e3)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x1a5) 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.GetFlagEffect(tp,id)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetLabelObject(tc)
e1:SetCondition(s.sumcon)
e1:SetOperation(s.sumop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_END)
e2:SetLabelObject(e1)
e2:SetOperation(s.cedop)
Duel.RegisterEffect(e2,tp)
end
Duel.SpecialSummonComplete()
end
end
function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetLabelObject())
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(1)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(aux.FALSE)
elseif Duel.GetCurrentChain()==1 then
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(s.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
end
function s.resetop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():ResetFlagEffect(id)
e:Reset()
end
function s.cedop(e,tp,eg,ep,ev,re,r,rp)
if Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS) and e:GetLabelObject():GetLabel()==1 and e:GetHandler():GetFlagEffect(id)~=0 then
Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
e:GetHandler():ResetFlagEffect(id)
e:Reset()
end
function s.fufilter(c,e,tp)
return c:IsFaceup() and c:IsCode(78371393)
end
function s.fucon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.fufilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.fucost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler())
and c:IsAbleToGraveAsCost() end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
Duel.SendtoGrave(c,REASON_COST)
end
function s.filter0(c)
return c:IsFaceup() and c:IsCanBeFusionMaterial()
end
function s.filter1(c,e)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function s.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 s.filter3(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
function s.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsSetCard,1,nil,0x1a5)
end
function s.futg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local mg2=Duel.GetMatchingGroup(s.filter0,tp,0,LOCATION_MZONE,nil)
mg1:Merge(mg2)
aux.FCheckAdditional=s.fcheck
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
aux.FCheckAdditional=nil
return Duel.GetFlagEffect(tp,id+o)==0 and res
end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.fuop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter3,nil,e)
local mg2=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2)
aux.FCheckAdditional=s.fcheck
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)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
aux.FCheckAdditional=nil
end
\ No newline at end of file
--蛇眼の炎燐
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_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
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:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
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)
--move
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_LEAVE_GRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1,id+o*2)
e4:SetTarget(s.mvtg)
e4:SetOperation(s.mvop)
c:RegisterEffect(e4)
end
--sp
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
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
--th
function s.thfilter(c)
return c:IsSetCard(0x19c) and c:IsType(TYPE_SPELL+TYPE_TRAP) 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>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--move
function s.filter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function s.mvtg(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) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function s.mvop(e,tp,eg,ep,ev,re,r,rp)
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(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)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--ポリノシス
function c91078716.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c91078716.condition1)
e1:SetCost(c91078716.cost)
e1:SetTarget(c91078716.target1)
e1:SetOperation(c91078716.activate1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e2)
--Activate(effect)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_CHAINING)
e3:SetCondition(c91078716.condition2)
e3:SetCost(c91078716.cost)
e3:SetTarget(c91078716.target2)
e3:SetOperation(c91078716.activate2)
c:RegisterEffect(e3)
end
function c91078716.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function c91078716.filter(c)
return c:IsRace(RACE_PLANT) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c91078716.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,c91078716.filter,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,c91078716.filter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c91078716.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c91078716.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c91078716.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c91078716.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c91078716.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--オスティナート
function c9113513.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c9113513.condition)
e1:SetTarget(c9113513.target)
e1:SetOperation(c9113513.activate)
c:RegisterEffect(e1)
end
function c9113513.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c9113513.filter1(c,e,tp,mg,f,chkf)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial()
and mg:IsExists(c9113513.filter2,1,c,e,tp,c,f,chkf)
end
function c9113513.filter2(c,e,tp,mc,f,chkf)
local mg=Group.FromCards(c,mc)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial()
and Duel.IsExistingMatchingCard(c9113513.ffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,f,chkf)
end
function c9113513.ffilter(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x9b) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c9113513.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
local res=mg1:IsExists(c9113513.filter1,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=mg2:IsExists(c9113513.filter1,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c9113513.filter0(c,e)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c9113513.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(c9113513.filter0,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e)
local g1=mg1:Filter(c9113513.filter1,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local g2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
g2=mg2:Filter(c9113513.filter1,nil,e,tp,mg2,mf,chkf)
end
local tc=nil
if g2~=nil and g2:GetCount()>0 and (g1:GetCount()==0 or Duel.SelectYesNo(tp,ce:GetDescription())) then
local mf=ce:GetValue()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg1=mg2:FilterSelect(tp,c9113513.filter1,1,1,nil,e,tp,mg2,mf,chkf)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg2=mg2:FilterSelect(tp,c9113513.filter2,1,1,nil,e,tp,sg1:GetFirst(),mf,chkf)
sg1:Merge(sg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c9113513.ffilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,sg1,mf,chkf)
tc=sg:GetFirst()
local fop=ce:GetOperation()
fop(ce,e,tp,tc,sg1)
elseif g1:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg1=mg1:FilterSelect(tp,c9113513.filter1,1,1,nil,e,tp,mg1,nil,chkf)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg2=mg1:FilterSelect(tp,c9113513.filter2,1,1,nil,e,tp,sg1:GetFirst(),nil,chkf)
sg1:Merge(sg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c9113513.ffilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,sg1,nil,chkf)
tc=sg:GetFirst()
tc:SetMaterial(sg1)
Duel.SendtoGrave(sg1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
end
if tc then
tc:RegisterFlagEffect(9113513,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
tc:CompleteProcedure()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetCondition(c9113513.descon)
e1:SetOperation(c9113513.desop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c9113513.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(9113513)~=0 then
return true
else
e:Reset()
return false
end
end
function c9113513.mgfilter(c,e,tp,fusc,mg)
return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE)
and c:GetReason()&(REASON_FUSION+REASON_MATERIAL)==(REASON_FUSION+REASON_MATERIAL) and c:GetReasonCard()==fusc
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and fusc:CheckFusionMaterial(mg,c,PLAYER_NONE,true)
end
function c9113513.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local mg=tc:GetMaterial()
local sumtype=tc:GetSummonType()
if Duel.Destroy(tc,REASON_EFFECT)~=0
and bit.band(sumtype,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION and mg:GetCount()>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=mg:GetCount()
and mg:IsExists(aux.NecroValleyFilter(c9113513.mgfilter),mg:GetCount(),nil,e,tp,tc,mg)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.SelectYesNo(tp,aux.Stringid(9113513,0)) then
Duel.SpecialSummon(mg,0,tp,tp,false,false,POS_FACEUP)
end
end
--神の忠告
function c92512625.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c92512625.condition1)
e1:SetCost(c92512625.cost)
e1:SetTarget(c92512625.target1)
e1:SetOperation(c92512625.activate1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
--Activate(effect)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_CHAINING)
e4:SetCondition(c92512625.condition2)
e4:SetCost(c92512625.cost)
e4:SetTarget(c92512625.target2)
e4:SetOperation(c92512625.activate2)
c:RegisterEffect(e4)
end
function c92512625.cfilter(c)
return c:IsFacedown() and c:GetSequence()<5
end
function c92512625.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_SZONE) and c:IsFacedown()
and not Duel.IsExistingMatchingCard(c92512625.cfilter,tp,LOCATION_SZONE,0,1,c)
end
function c92512625.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
and c92512625.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c92512625.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,3000) end
Duel.PayLPCost(tp,3000)
end
function c92512625.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c92512625.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c92512625.condition2(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
and c92512625.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c92512625.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c92512625.activate2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--マチュア・クロニクル
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableCounterPermit(0x25)
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)
--counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(s.counter)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCountLimit(1,id)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCost(s.cost1)
e3:SetTarget(s.tg1)
e3:SetOperation(s.op1)
c:RegisterEffect(e3)
--to hand from removed
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCountLimit(1,id)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCost(s.cost2)
e4:SetTarget(s.tg2)
e4:SetOperation(s.op2)
c:RegisterEffect(e4)
--remove from deck
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_REMOVE)
e5:SetDescription(aux.Stringid(id,2))
e5:SetCountLimit(1,id)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetCost(s.cost3)
e5:SetTarget(s.tg3)
e5:SetOperation(s.op3)
c:RegisterEffect(e5)
--destory
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_DESTROY)
e6:SetDescription(aux.Stringid(id,3))
e6:SetCountLimit(1,id)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCost(s.cost4)
e6:SetTarget(s.tg4)
e6:SetOperation(s.op4)
c:RegisterEffect(e6)
--to hand from deck
local e7=Effect.CreateEffect(c)
e7:SetCategory(CATEGORY_TOHAND)
e7:SetDescription(aux.Stringid(id,4))
e7:SetCountLimit(1,id)
e7:SetType(EFFECT_TYPE_IGNITION)
e7:SetRange(LOCATION_SZONE)
e7:SetCost(s.cost5)
e7:SetTarget(s.tg5)
e7:SetOperation(s.op5)
c:RegisterEffect(e7)
end
function s.cfilter(c)
return c:IsSetCard(0x1a5) or aux.IsCodeListed(c,78371393)
end
function s.counter(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.cfilter,1,nil) then
e:GetHandler():AddCounter(0x25,1)
end
end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x25,1,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x25,1,REASON_COST)
end
function s.filter1(c,e,tp)
return c:IsCode(78371393) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter1),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP)
end
end
function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x25,2,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x25,2,REASON_COST)
end
function s.filter2(c,e,tp)
return c:IsAbleToHand()
end
function s.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true
and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function s.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if g:GetCount()>0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function s.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x25,3,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x25,3,REASON_COST)
end
function s.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function s.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,1,nil)
local tg=g:GetFirst()
if tg==nil then return end
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
function s.cost4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x25,4,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x25,4,REASON_COST)
end
function s.tg4(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,1,0,0)
end
function s.op4(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function s.cost5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x25,5,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x25,5,REASON_COST)
end
function s.filter5(c,e,tp)
return c:IsAbleToHand() and c:IsCode(48130397)
end
function s.tg5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true
and Duel.IsExistingMatchingCard(s.filter5,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.op5(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter5,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g:GetFirst(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--運命湾曲
function c94662235.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c94662235.condition1)
e1:SetTarget(c94662235.target1)
e1:SetOperation(c94662235.activate1)
c:RegisterEffect(e1)
--Activate(effect)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c94662235.condition2)
e2:SetTarget(aux.nbtg)
e2:SetOperation(c94662235.activate2)
c:RegisterEffect(e2)
end
function c94662235.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x31)
end
function c94662235.check(tp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
return g:IsExists(c94662235.cfilter,1,nil)
and not g:IsExists(aux.NOT(c94662235.cfilter),1,nil)
end
function c94662235.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and c94662235.check(tp)
end
function c94662235.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:GetFirst():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
function c94662235.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg:GetFirst())
local ec=eg:GetFirst()
if Duel.Remove(ec,POS_FACEUP,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabelObject(ec)
e1:SetCondition(c94662235.retcon)
e1:SetOperation(c94662235.retop)
Duel.RegisterEffect(e1,tp)
ec:RegisterFlagEffect(94662235,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c94662235.condition2(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and c94662235.check(tp)
end
function c94662235.activate2(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
if Duel.NegateActivation(ev) and ec:IsRelateToEffect(re) then
if Duel.Remove(ec,POS_FACEUP,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabelObject(ec)
e1:SetCondition(c94662235.retcon)
e1:SetOperation(c94662235.retop)
Duel.RegisterEffect(e1,tp)
ec:RegisterFlagEffect(94662235,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
end
function c94662235.retcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return tc:GetFlagEffect(94662235)~=0
end
function c94662235.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
--聖霊獣騎 レイラウタリ
local s,id,o=GetID()
function s.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),3)
c:EnableReviveLimit()
--cannot release(uncompleted)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_RELEASE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,1)
e1:SetTarget(s.rellimit)
c:RegisterEffect(e1)
--tohand/extra & summon bonus
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TOEXTRA)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.bstg)
e2:SetOperation(s.bsop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.rmcon)
e3:SetTarget(s.rmtg)
e3:SetOperation(s.rmop)
c:RegisterEffect(e3)
end
function s.rellimit(e,c,tp,r)
return r&REASON_COST~=0
end
function s.bfilter(c)
return c:IsSetCard(0xb5) and c:IsFaceup() and c:IsAbleToHand()
end
function s.sfilter(c)
return c:IsSetCard(0xb5) and c:IsSummonable(true,nil)
end
function s.bstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.bfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.bfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local g=Duel.SelectTarget(tp,s.bfilter,tp,LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst()
if tc:IsAbleToExtra() then
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,1,0,0)
else
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
end
function s.bsop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetTargetsRelateToChain():GetFirst()
if tc then
if Duel.SendtoHand(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sumc=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
if sumc then Duel.Summon(tp,sumc,true,nil) end
end
end
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function s.rmfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0xb5) and c:IsAbleToRemove()
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,s.rmfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,g1:GetCount(),0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetsRelateToChain()
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
end
--月朧龍ヴァグナワ
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--ATK change && Damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.adcon)
e1:SetTarget(s.adtg)
e1:SetOperation(s.adop)
c:RegisterEffect(e1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(s.valcheck)
e0:SetLabelObject(e1)
c:RegisterEffect(e0)
end
function s.valcheck(e,c)
local g=c:GetMaterial()
local mg=g:Filter(Card.IsTuner,nil,c)
local tc=mg:GetFirst()
if not tc then
e:GetLabelObject():SetLabel(0)
return
end
if #mg>1 then
local tg=g-(g:Filter(Card.IsNotTuner,nil,c))
if #tg>0 then
tc=tg:GetFirst()
end
end
local lv=tc:GetSynchroLevel(c)
local lv2=lv>>16
lv=lv&0xffff
if lv2>0 and not g:CheckWithSumEqual(Card.GetLevel,c:GetLevel(),#g,#g,c) then
lv=lv2
end
if tc:IsHasEffect(89818984) and not g:CheckWithSumEqual(Card.GetSynchroLevel,c:GetLevel(),#g,#g,c) then
lv=2
end
e:GetLabelObject():SetLabel(lv,c:GetLevel()-lv)
end
function s.adcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
local dam,atk=e:GetLabel()
if chk==0 then return atk>0 and dam>0 end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam*300)
end
function s.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dam,atk=e:GetLabel()
if not c:IsRelateToChain() or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,2)
e1:SetValue(atk*300)
c:RegisterEffect(e1)
Duel.BreakEffect()
Duel.Damage(1-tp,dam*300,REASON_EFFECT)
end
\ No newline at end of file
--Asset Mountis
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--pos change
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.poscon)
e2:SetTarget(s.postg)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id+o*2)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.spfilter(c)
return c:IsFaceup() and c:IsLevelBelow(6)
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.IsExistingMatchingCard(s.spfilter,c:GetControler(),0,LOCATION_MZONE,1,nil)
end
function s.filter(c)
return c:IsFaceup() and c:IsCanChangePosition()
end
function s.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,sg,sg:GetCount(),0,0)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.ChangePosition(sg,POS_FACEUP_DEFENSE,0,POS_FACEUP_ATTACK,0)
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(c:GetAttribute())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if tc:GetLevel()>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(c:GetLevel())
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
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(s.splimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function s.splimit(e,c)
return not c:IsRace(RACE_INSECT)
end
function s.thfilter(c)
return c:IsLevelAbove(8) and c:IsRace(RACE_INSECT) 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
--地縛融合
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_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--search
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)
e2:SetCost(aux.bfgcost)
e2:SetCondition(s.condition1)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
--to spsummon 0x21
function s.condition1(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
and Duel.IsExistingMatchingCard(nil,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x21) 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_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
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:IsType(TYPE_SYNCHRO) or c:IsType(TYPE_FUSION)) and c:IsLocation(LOCATION_EXTRA)
end
--fusion
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
or ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) 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.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(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 mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
\ No newline at end of file
--RR-ノアール・レイニアス
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.lvtg)
e2:SetOperation(s.lvop)
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_SUMMON_SUCCESS)
ge1:SetLabel(id)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)>0
end
function s.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xba) and c:IsLevelAbove(0) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c)
end
function s.thfilter(c,rc)
return c:GetLevel()~=rc:GetLevel() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0xba) and c:IsAbleToHand()
end
function s.thtg(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 return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
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)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function s.lvfilter(c)
return c:IsFaceup() and c:IsLevelAbove(0) and c:IsSetCard(0xba)
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.lvfilter,tp,LOCATION_MZONE,0,nil)
local sel=0
local lv=1
if not g:IsExists(Card.IsLevelAbove,1,nil,2) then
sel=Duel.SelectOption(tp,aux.Stringid(id,0))
else
sel=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1))
end
if sel==1 then
lv=-1
end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
This diff is collapsed.
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