Commit 2bfd8e2d authored by Nemo Ma's avatar Nemo Ma

no42pre

parent 33e2c7f7
--ガスタの聖域
function c84610002.initial_effect(c)
--disable spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_FZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetTargetRange(1,1)
e1:SetTarget(c84610002.sumlimit)
e1:SetCondition(c84610002.effcon)
e1:SetLabel(4)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_DECK+LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,LOCATION_DECK+LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA)
e2:SetTarget(c84610002.target)
e2:SetCondition(c84610002.effcon)
e2:SetLabel(4)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_DISABLE_EFFECT)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_DISABLE_TRAPMONSTER)
c:RegisterEffect(e4)
--tohand+search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c84610002.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84610002,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c84610002.spcon)
e2:SetCost(c84610002.spcost)
e2:SetTarget(c84610002.sptg)
e2:SetOperation(c84610002.spop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84610002,1))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCondition(c84610002.dicon)
e3:SetCost(c84610002.spcost)
e3:SetTarget(c84610002.target1)
e3:SetOperation(c84610002.operation1)
c:RegisterEffect(e3)
--to grave
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(84610002,2))
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetTarget(c84610002.target2)
e4:SetOperation(c84610002.operation2)
c:RegisterEffect(e4)
--indes
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_ONFIELD,0)
e5:SetTarget(c84610002.indestg)
e5:SetCondition(c84610002.effcon)
e5:SetLabel(2)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e6:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e6:SetValue(aux.tgoval)
c:RegisterEffect(e6)
--Activate
local e7=e5:Clone()
e7:SetCode(EFFECT_PATRICIAN_OF_DARKNESS)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetTargetRange(0,1)
c:RegisterEffect(e7)
end
function c84610002.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x10)
end
function c84610002.target(e,c)
return not c:IsSetCard(0x10)
end
function c84610002.effilter(c)
return c:IsFaceup() and c:IsSetCard(0x10)
end
function c84610002.effcon(e)
return Duel.GetMatchingGroupCount(c84610002.effilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)>=e:GetLabel()
end
function c84610002.thfilter(c)
return c:IsSetCard(0x10) and c:IsAbleToHand()
end
function c84610002.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c84610002.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(84610002,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c84610002.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c84610002.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_DISCARD+REASON_COST,nil)
end
function c84610002.spfilter(c,e,tp)
return c:IsSetCard(0x10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610002.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610002.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84610002.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84610002.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 c84610002.dicon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c84610002.filter1(c)
return c:IsSetCard(0x10) and c:IsAbleToDeck()
end
function c84610002.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(c84610002.filter1,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,LOCATION_ONFILED)
end
function c84610002.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectMatchingCard(tp,c84610002.filter1,tp,LOCATION_GRAVE,0,1,1,nil)
if g1:GetCount()>0 then
Duel.HintSelection(g1)
Duel.SendtoDeck(g1,nil,2,REASON_EFFECT)
end
local g2=Duel.GetMatchingGroup(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g2:GetCount()==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=g2:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
function c84610002.tgfilter(c)
return c:IsSetCard(0x10) and c:IsAbleToGrave()
end
function c84610002.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610002.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c84610002.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c84610002.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c84610002.indestg(e,c)
return c:IsSetCard(0x10) and c:IsType(TYPE_MONSTER)
end
--リチュアの巫女 エリアル
function c84610003.initial_effect(c)
--inactivatable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetRange(LOCATION_ONFIELD)
e1:SetValue(c84610003.effectfilter)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
e2:SetRange(LOCATION_ONFIELD)
e2:SetValue(c84610003.effectfilter)
c:RegisterEffect(e2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHAIN_NEGATED)
e1:SetRange(LOCATION_DECK)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c84610003.spcon)
e1:SetCost(c84610003.spcost)
e1:SetTarget(c84610003.sptg)
e1:SetOperation(c84610003.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_DISABLED)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_ONFIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetValue(1)
c:RegisterEffect(e3)
--copy active
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetCountLimit(2)
e4:SetCost(c84610003.cocost)
e4:SetTarget(c84610003.cotarget)
e4:SetOperation(c84610003.cooperation)
c:RegisterEffect(e4)
--search
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_HAND)
e6:SetCost(c84610003.cost)
e6:SetTarget(c84610003.target)
e6:SetOperation(c84610003.operation)
c:RegisterEffect(e6)
end
function c84610003.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return tc:IsSetCard(0x3a)
end
function c84610003.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c84610003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function c84610003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c84610003.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c84610003.cocost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return e:GetHandler():GetFlagEffect(84610003)<3 end
e:GetHandler():RegisterFlagEffect(84610003,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c84610003.filter1(c)
return c:IsType(TYPE_TRAP+TYPE_SPELL) and c:IsSetCard(0x3a) and c:IsAbleToGraveAsCost()
and c:CheckActivateEffect(false,true,false)~=nil
end
function c84610003.cotarget(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(c84610003.filter1,tp,LOCATION_HAND,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c84610003.filter1,tp,LOCATION_HAND,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.SendtoGrave(g,REASON_COST)
e:SetCategory(te:GetCategory())
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.SetOperationInfo(0,CATEGORY_DESTROY,nil,0,0,0)
end
function c84610003.cooperation(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 c84610003.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 c84610003.filter(c)
return c:IsSetCard(0x3a) and c:IsAbleToHand()
end
function c84610003.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c84610003.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84610003.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610003.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--妖精伝姫-ケール
function c84610004.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--activate limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_PZONE+LOCATION_MZONE)
e1:SetOperation(c84610004.actlimit1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetOperation(c84610004.actlimit2)
c:RegisterEffect(e2)
if not c84610004.global_check then
c84610004.global_check=true
local e3=e1:Clone()
e3:SetRange(0xff)
e3:SetOperation(c84610004.checkop1)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EVENT_CHAIN_NEGATED)
e4:SetRange(0xff)
e4:SetOperation(c84610004.checkop2)
c:RegisterEffect(e4)
end
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetRange(LOCATION_PZONE+LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetCondition(c84610004.condition)
e5:SetValue(aux.TRUE)
c:RegisterEffect(e5)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c84610004.pspcon)
e1:SetTarget(c84610004.psptg1)
e1:SetOperation(c84610004.pspop1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetTarget(c84610004.psptg2)
e2:SetOperation(c84610004.pspop2)
c:RegisterEffect(e2)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetTarget(c84610004.sptg1)
e1:SetOperation(c84610004.spop1)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84610004,0))
e2:SetCategory(CATEGORY_SUMMON+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetTarget(c84610004.sumtg)
e2:SetOperation(c84610004.sumop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84610004,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c84610004.spcost)
e3:SetCondition(c84610004.pspcon)
e3:SetTarget(c84610004.sptg2)
e3:SetOperation(c84610004.spop2)
c:RegisterEffect(e3)
end
function c84610004.actlimit1(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
e:GetHandler():RegisterFlagEffect(84610004,RESET_EVENT+0x27e0000+RESET_PHASE+PHASE_END,0,1)
end
function c84610004.actlimit2(e,tp,eg,ep,ev,re,r,rp)
if ep==1-tp then
if e:GetHandler():GetFlagEffect(84610004)==1 then
e:GetHandler():ResetFlagEffect(84610004)
end
if e:GetHandler():GetFlagEffect(84610004)>1 then
e:GetHandler():ResetFlagEffect(84610004)
e:GetHandler():RegisterFlagEffect(84610004,RESET_EVENT+0x27e0000+RESET_PHASE+PHASE_END,0,1)
end
end
end
function c84610004.checkop1(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then
Duel.RegisterFlagEffect(1-tp,1,RESET_PHASE+PHASE_END,0,1)
else
Duel.RegisterFlagEffect(tp,1,RESET_PHASE+PHASE_END,0,1)
end
end
function c84610004.checkop2(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then
if Duel.GetFlagEffect(1-tp,84610004)==1 then
Duel.ResetFlagEffect(1-tp,84610004)
end
if Duel.GetFlagEffect(1-tp,84610004)>1 then
Duel.ResetFlagEffect(1-tp,84610004)
Duel.RegisterFlagEffect(1-tp,84610004,RESET_PHASE+PHASE_END,0,1)
end
end
if ep==1-tp then
if Duel.GetFlagEffect(tp,84610004)==1 then
Duel.ResetFlagEffect(tp,84610004)
end
if Duel.GetFlagEffect(tp,84610004)>1 then
Duel.ResetFlagEffect(tp,84610004)
Duel.RegisterFlagEffect(tp,84610004,RESET_PHASE+PHASE_END,0,1)
end
end
end
function c84610004.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(84610004)>1
end
function c84610004.cfilter(c,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
end
function c84610004.pspcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c84610004.cfilter,1,nil,tp)
end
function c84610004.psptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c84610004.pspop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c84610004.pfilter1(c,e,tp)
if not c:IsFaceup() or not c:IsRace(RACE_SPELLCASTER)then return false end
local g=Duel.GetMatchingGroup(c84610004.pfilter2,tp,LOCATION_DECK,0,nil,e,tp,c)
return g:GetClassCount(Card.GetCode)>1
end
function c84610004.pfilter2(c,e,tp,tc)
return c:IsLevel(tc:GetLevel()) and c:IsAttack(1850)and c:IsRace(tc:GetRace()) and c:IsAttribute(tc:GetAttribute())
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610004.psptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c84610004.pfilter1(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c84610004.pfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c84610004.pfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
end
function c84610004.pspop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c84610004.pfilter2,tp,LOCATION_DECK,0,nil,e,tp,tc)
if not Duel.IsPlayerAffectedByEffect(tp,59822133)
and ft>1 and g:GetClassCount(Card.GetCode)>1 and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=g:Select(tp,1,1,nil)
g1:Merge(g2)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
Duel.Damage(tp,2000,REASON_EFFECT)
end
end
function c84610004.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1)>1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and rp==1-tp and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c84610004.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c84610004.sumfilter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttack(1850) and c:IsSummonable(true,nil)
end
function c84610004.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610004.sumfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
end
function c84610004.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c84610004.sumfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
Duel.Damage(tp,1000,REASON_EFFECT)
end
end
function c84610004.gfilter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsAbleToGraveAsCost()
end
function c84610004.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610004.gfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c84610004.gfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_COST)
end
end
function c84610004.spfilter(c,e,tp)
return c:IsAttack(1850) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610004.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c84610004.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c84610004.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c84610004.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c84610004.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
--EM振り子の魔術師
function c84610005.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--pendulum set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84610005,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetTarget(c84610005.pstg)
e1:SetOperation(c84610005.psop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84610005,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetCondition(c84610005.pspcon)
e2:SetTarget(c84610005.psptg)
e2:SetOperation(c84610005.pspop)
c:RegisterEffect(e2)
--change scale
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84610005,2))
e3:SetCategory(CATEGORY_TOEXTRA)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,84610005)
e3:SetTarget(c84610005.sctg)
e3:SetOperation(c84610005.scop)
c:RegisterEffect(e3)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c84610005.thcon)
e1:SetTarget(c84610005.thtg)
e1:SetOperation(c84610005.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c84610005.spcon)
e2:SetTarget(c84610005.sptg)
e2:SetOperation(c84610005.spop)
c:RegisterEffect(e2)
--Attribute Dark
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetValue(ATTRIBUTE_DARK)
c:RegisterEffect(e1)
end
function c84610005.psfilter(c)
return c:IsType(TYPE_PENDULUM) and not c:IsCode(84610005) and not c:IsForbidden()
end
function c84610005.pstg(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))
and Duel.IsExistingMatchingCard(c84610005.psfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610005.psop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c84610005.psfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function c84610005.pcfilter(c)
return c:IsType(TYPE_PENDULUM) and (c:IsSetCard(0x98) or c:IsSetCard(0x9f) or c:IsSetCard(0xf2))
end
function c84610005.pspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c84610005.pcfilter,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c84610005.pspfilter(c,e,tp)
return (c:IsSetCard(0x98) or c:IsSetCard(0x9f) or c:IsSetCard(0xf2)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610005.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local sc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c84610005.pspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetTargetCard(sc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610005.pspop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84610005.pspfilter,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
end
function c84610005.scfilter(c,pc)
return c:IsType(TYPE_PENDULUM) and (c:IsSetCard(0x98) or c:IsSetCard(0x9f) or c:IsSetCard(0xf2))
end
function c84610005.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610005.scfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610005.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29432356,1))
local g=Duel.SelectMatchingCard(tp,c84610005.scfilter,tp,LOCATION_DECK,0,1,1,nil,c)
local tc=g:GetFirst()
if tc and Duel.SendtoExtraP(tc,tp,REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LSCALE)
e1:SetValue(tc:GetLeftScale())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RSCALE)
e2:SetValue(tc:GetRightScale())
c:RegisterEffect(e2)
end
end
function c84610005.thfilter(c)
return (c:IsType(TYPE_PENDULUM) or c:IsSetCard(0xf2)) and c:IsAbleToHand()
end
function c84610005.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c84610005.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610005.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84610005.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610005.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c84610005.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c84610005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610005.pspfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c84610005.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,c84610005.pspfilter,tp,LOCATION_HAND+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
--F・HERO リマーカブル
function c84610006.initial_effect(c)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c84610006.hspcon)
e1:SetOperation(c84610006.hspop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84610006,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,84610006)
e2:SetTarget(c84610006.sptg)
e2:SetOperation(c84610006.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(84610006,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetTarget(c84610006.sptg2)
e4:SetOperation(c84610006.spop2)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
--summon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(84610006,2))
e6:SetCategory(CATEGORY_SUMMON)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetHintTiming(TIMING_MAIN_END,TIMING_MAIN_END)
e6:SetCondition(c84610006.sumcon)
e6:SetTarget(c84610006.sumtg)
e6:SetOperation(c84610006.sumop)
c:RegisterEffect(e6)
--destroy
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(84610006,3))
e7:SetCategory(CATEGORY_DESTROY)
e7:SetType(EFFECT_TYPE_IGNITION)
e7:SetRange(LOCATION_HAND+LOCATION_MZONE)
e7:SetCost(c84610006.descost)
e7:SetTarget(c84610006.destg)
e7:SetOperation(c84610006.desop)
c:RegisterEffect(e7)
end
function c84610006.hspfilter(c,tp)
return c:IsFaceup() and c:IsCode(40044918) and c:IsAbleToDeckAsCost()
and Duel.GetMZoneCount(tp,c)>0
end
function c84610006.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610006.hspfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function c84610006.hspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c84610006.hspfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoDeck(g,POS_FACEUP,1,REASON_COST)
end
function c84610006.spfilter(c,e,tp)
return c:IsCode(40044918) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(84610006)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610006.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(84610006,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610006.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,c84610006.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
function c84610006.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(84610006)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610006.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(84610006,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610006.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84610006.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
function c84610006.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c84610006.sumfilter(c)
return c:IsSetCard(0x8) and c:IsSummonable(true,nil)
end
function c84610006.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610006.sumfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c84610006.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c84610006.sumfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function c84610006.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c84610006.desfilter(c)
return c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)
end
function c84610006.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610006.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c84610006.desfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c84610006.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c84610006.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
local tc=g:GetFirst()
if not tc then return end
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
--水晶機巧-シンクロン
function c84610007.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c84610007.spcost)
e1:SetTarget(c84610007.sptg)
e1:SetOperation(c84610007.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
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:SetCondition(c84610007.sccon)
e3:SetTarget(c84610007.sctg)
e3:SetOperation(c84610007.scop)
c:RegisterEffect(e3)
--level
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c84610007.lvtg)
e4:SetOperation(c84610007.lvop)
c:RegisterEffect(e4)
--set
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,84610007)
e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetCost(aux.bfgcost)
e5:SetCondition(c84610007.setcon)
e5:SetOperation(c84610007.setop)
c:RegisterEffect(e5)
end
function c84610007.gfilter(c)
return c:IsSetCard(0xea)
end
function c84610007.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610007.gfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c84610007.gfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_COST)
end
end
function c84610007.spfilter(c,e,tp)
return c:IsSetCard(0xea) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(84610007)
end
function c84610007.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610007.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84610007.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,c84610007.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
function c84610007.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and e:GetHandler():GetFlagEffect(84610007)<1
end
function c84610007.scfilter1(c,e,tp,mc)
local mg=Group.FromCards(c,mc)
return not c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c84610007.scfilter2,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function c84610007.scfilter2(c,mg)
return c:IsSynchroSummonable(nil,mg)
end
function c84610007.sctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_DECK) and chkc:IsControler(tp) and c84610007.scfilter1(chkc,e,tp,e:GetHandler()) end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c84610007.scfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(84610007,RESET_CHAIN,0,1)
end
function c84610007.scop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,c84610007.scfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetHandler())
local tc=g:GetFirst()
if not tc or not Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
if not c:IsRelateToEffect(e) then return end
local mg=Group.FromCards(c,tc)
local g=Duel.GetMatchingGroup(c84610007.scfilter2,tp,LOCATION_EXTRA,0,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
function c84610007.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINGMSG_LVRANK)
local lv=Duel.AnnounceLevel(tp,1,3)
e:SetLabel(lv)
end
function c84610007.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local fid=0
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
fid=c:GetRealFieldID()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(0xff,0xff)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e2,true)
end
end
function c84610007.setcon(c,tp)
return Duel.IsExistingMatchingCard(c84610007.setfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c)
end
function c84610007.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSetCard(0xea) and c:IsSSetable()
end
function c84610007.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c84610007.setfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SSet(tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
--F・HERO ライト・ミスト
function c84610008.initial_effect(c)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c84610008.hspcon)
e1:SetOperation(c84610008.hspop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c84610008.sptg)
e2:SetOperation(c84610008.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c84610008.spcon)
e4:SetTarget(c84610008.sptg2)
e4:SetOperation(c84610008.spop2)
c:RegisterEffect(e4)
end
function c84610008.hspfilter(c,tp)
return c:IsCode(50720316) and c:IsAbleToDeckAsCost()
and Duel.GetMZoneCount(tp,c)>0
end
function c84610008.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610008.hspfilter,tp,LOCATION_GRAVE,0,1,nil,tp)
end
function c84610008.hspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c84610008.hspfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SendtoDeck(g,nil,1,REASON_COST)
end
function c84610008.spfilter(c,e,tp)
return c:IsCode(50720316) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610008.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84610008.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,c84610008.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
function c84610008.cfilter(c,tp)
return c:IsControler(tp) and c:IsSetCard(0x8) and c:IsType(TYPE_FUSION)
end
function c84610008.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c84610008.cfilter,1,nil,tp)
end
function c84610008.tsfilter(c,tp)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c84610008.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(c84610008.tsfilter,tp,LOCATION_DECK,0,1,nil,e,tp,ft) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK)
end
function c84610008.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84610008.tsfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft)
local tc=g:GetFirst()
if tc then
if ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
--F・HERO アクアフェーミナ
function c84610009.initial_effect(c)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c84610009.hspcon)
e1:SetOperation(c84610009.hspop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c84610009.sptg)
e2:SetOperation(c84610009.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetHintTiming(TIMING_MAIN_END,TIMING_MAIN_END)
e4:SetCost(c84610009.spcost)
e4:SetTarget(c84610009.sptg2)
e4:SetOperation(c84610009.sptg2)
c:RegisterEffect(e4)
end
function c84610009.hspfilter(c,tp)
return c:IsFaceup() and c:IsCode(63060238) and c:IsAbleToDeckAsCost()
and Duel.GetMZoneCount(tp,c)>0
end
function c84610009.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610009.hspfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function c84610009.hspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c84610009.hspfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoDeck(g,POS_FACEUP,1,REASON_COST)
end
function c84610009.spfilter(c,e,tp)
return c:IsCode(63060238) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610009.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84610009.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,c84610009.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
function c84610009.cfilter(c)
return c:IsCode(24094653) and c:IsDiscardable()
end
function c84610009.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610009.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c84610009.cfilter,1,1,REASON_DISCARD+REASON_COST,nil)
end
function c84610009.fsfilter(c,e,tp)
return c:IsSetCard(0x8) and c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,true,false)
end
function c84610009.gfilter(c)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c84610009.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c84610009.gfilter,tp,LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>2
and Duel.GetLocationCountFromEx(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610009.fsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,3,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c84610009.spop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c84610009.gfilter,tp,LOCATION_MZONE,0,nil)
if g:GetClassCount(Card.GetCode)<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:Select(tp,3,3,nil)
g:Remove(Card.IsCode,nil,tg:GetFirst():GetCode())
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 and tg:IsExists(Card.IsLocation,3,nil,LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84610009.fsfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
--フレッシュマドルチェ・アソーティ
function c84610010.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x71),2,2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,84610010)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c84610010.spcost)
e1:SetTarget(c84610010.sptg)
e1:SetOperation(c84610010.spop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c84610010.thcon)
e2:SetTarget(c84610010.thtg)
e2:SetOperation(c84610010.thop)
c:RegisterEffect(e2)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetCondition(c84610010.indescon)
e1:SetTarget(c84610010.indestg)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--activate from hand
local e3=e1:Clone()
e3:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x71))
e3:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x71))
e4:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e4)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c84610010.imcon)
e1:SetOperation(c84610010.imop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c84610010.spcfilter(c)
return c:IsSetCard(0x71) and c:IsAbleToDeckAsCost()
end
function c84610010.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetMatchingGroup(c84610010.spcfilter,tp,LOCATION_HAND,0,e:GetHandler())
if chk==0 then return rg:GetClassCount(Card.GetCode)>=4 end
local g=Group.CreateGroup()
for i=1,4 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=rg:Select(tp,1,1,nil):GetFirst()
rg:Remove(Card.IsCode,nil,tc:GetCode())
g:AddCard(tc)
end
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c84610010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84610010.spfilter(c,e,tp)
return c:IsSetCard(0x71) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610010.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c then
ct=Duel.SpecialSummon(c,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP)
c:CompleteProcedure()
end
if ct>0 then
local fg=Duel.GetMatchingGroup(c84610010.spfilter,tp,LOCATION_DECK,0,nil,e,tp,false,false)
if fg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(84610010,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=fg:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c84610010.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c84610010.thfilter(c)
return c:IsSetCard(0x71) and c:IsAbleToHand()
end
function c84610010.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610010.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84610010.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610010.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c84610010.indesfilter(c)
return c:IsFaceup() and c:IsSetCard(0x71)
end
function c84610010.indescon(e)
return e:GetHandler():GetLinkedGroup():IsExists(c84610010.indesfilter,1,nil)
end
function c84610010.indestg(e,c)
return c:IsSetCard(0x71) and c:IsType(TYPE_MONSTER)
end
function c84610010.cfilter(c,ec)
if c:IsLocation(LOCATION_MZONE) then
return c:IsSetCard(0x71) and c:IsFaceup() and ec:GetLinkedGroup():IsContains(c)
else
return c:IsPreviousSetCard(0x71) and c:IsPreviousPosition(POS_FACEUP)
and bit.extract(ec:GetLinkedZone(c:GetPreviousControler()),c:GetPreviousSequence())~=0
end
end
function c84610010.imcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c84610010.cfilter,1,nil,e:GetHandler())
end
function c84610010.imop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x71))
e1:SetValue(c84610010.ifilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c84610010.ifilter(e,re)
return re:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
--先史遺産クリスタル・キューブ
function c84610011.initial_effect(c)
--xyz summon
aux.AddXyzProcedureLevelFree(c,c84610011.mfilter,c84610011.xyzcheck,2,2)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_ROCK+RACE_MACHINE),2,2)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,84610011)
e1:SetCondition(c84610011.condition)
e1:SetTarget(c84610011.sptg)
e1:SetOperation(c84610011.spop)
c:RegisterEffect(e1)
--search
local e2=e1:Clone()
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetCountLimit(1,84611011)
e2:SetCondition(c84610011.condition2)
e2:SetTarget(c84610011.thtg)
e2:SetOperation(c84610011.thop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84610011,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c84610011.cost)
e3:SetTarget(c84610011.thtg2)
e3:SetOperation(c84610011.thop2)
c:RegisterEffect(e3)
--summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(84610011,1))
e4:SetCategory(CATEGORY_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_ONFIELD,0)
e4:SetCountLimit(1)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetCondition(c84610011.sumcon)
e4:SetTarget(c84610011.sumtg)
e4:SetOperation(c84610011.sumop)
c:RegisterEffect(e4)
--cannot be battle target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetCondition(c84610011.cbcon)
e5:SetValue(c84610011.cbval)
c:RegisterEffect(e5)
--negate
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_CHAIN_SOLVING)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c84610011.necon)
e6:SetOperation(c84610011.neop)
c:RegisterEffect(e6)
--negate
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(84610011,2))
e7:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e7:SetCode(EVENT_CHAINING)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c84610011.discon)
e7:SetCost(c84610011.discost)
e7:SetTarget(c84610011.distg)
e7:SetOperation(c84610011.disop)
c:RegisterEffect(e7)
end
function c84610011.mfilter(c,xyzc)
return (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_ROCK)) and not c:IsType(TYPE_XYZ)
end
function c84610011.xyzcheck(g)
return g:GetClassCount(Card.GetLevel)==1 and g:IsExists(Card.IsSetCard,1,nil,0x70)
end
function c84610011.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c84610011.spfilter(c,e,tp)
return c:IsSetCard(0x70) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610011.xyzfilter(c,mg)
return (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_ROCK)) and not c:IsCode(84610011) and c:IsXyzSummonable(mg,2,2) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c84610011.fgoal(sg,exg)
return aux.dncheck(sg) and exg:IsExists(Card.IsXyzSummonable,1,nil,sg,#sg,#sg)
end
function c84610011.mfilter1(c,mg,exg)
return mg:IsExists(c84610011.mfilter2,1,c,c,exg)
end
function c84610011.mfilter2(c,mc,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc))
end
function c84610011.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c84610011.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
local exg=Duel.GetMatchingGroup(c84610011.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and exg:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA)
end
function c84610011.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local mg=Duel.GetMatchingGroup(c84610011.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
local exg=Duel.GetMatchingGroup(c84610011.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if mg:GetCount()<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=mg:SelectSubGroup(tp,c84610011.fgoal,false,2,2,exg)
if sg:GetCount()<2 then return end
local tc1=sg:GetFirst()
local tc2=sg:GetNext()
Duel.SpecialSummonStep(tc1,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc1:RegisterEffect(e1)
local e2=e1:Clone()
tc2:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc1:RegisterEffect(e3)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
local xyzg=Duel.GetMatchingGroup(c84610011.xyzfilter,tp,LOCATION_EXTRA,0,nil,sg)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,sg)
end
end
function c84610011.tfilter(c)
return c:IsSetCard(0x70) and c:IsAbleToHand()
end
function c84610011.condition2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c84610011.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610011.tfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84610011.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610011.tfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c84610011.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c84610011.tfilter2(c)
return (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_ROCK)) and c:IsAbleToHand()
end
function c84610011.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610011.tfilter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84610011.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610011.tfilter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c84610011.cfilter(c)
return c:IsFaceup() and (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_ROCK))
end
function c84610011.sumcon(e)
return e:GetHandler():GetLinkedGroup():IsExists(c84610011.cfilter,1,nil)
end
function c84610011.sumfilter(c)
return (c:IsRace(RACE_ROCK) or c:IsRace(RACE_MACHINE)) and c:IsSummonable(true,nil)
end
function c84610011.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610011.sumfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c84610011.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c84610011.sumfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function c84610011.cfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x70)
end
function c84610011.cbcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroup():IsExists(c84610011.cfilter2,1,nil)
end
function c84610011.cbval(e,c)
return c~=e:GetHandler() and c:IsFaceup() and (c:IsRace(RACE_ROCK) or c:IsRace(RACE_MACHINE))
end
function c84610011.necon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return e:GetHandler():GetLinkedGroup():IsExists(c84610011.cfilter2,1,nil) and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsAttack(0) and re:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function c84610011.neop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c84610011.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return re:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c84610011.cfilter3(c)
return c:IsFaceup() and c:IsSetCard(0x70) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c84610011.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c84610011.cfilter3,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c84610011.cfilter3,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c84610011.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c84610011.disop(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 c84610012.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCost(c84610012.cost)
e1:SetTarget(c84610012.target)
e1:SetOperation(c84610012.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetTarget(c84610012.tar)
e2:SetOperation(c84610012.act)
c:RegisterEffect(e2)
--to hand+search
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c84610012.thcost)
e3:SetTarget(c84610012.thtg)
e3:SetOperation(c84610012.thop)
c:RegisterEffect(e3)
end
function c84610012.cfilter(c)
return c:IsSetCard(0x3a) and c:IsDiscardable()
end
function c84610012.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610012.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c84610012.cfilter,1,1,REASON_DISCARD+REASON_COST,nil)
end
function c84610012.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c84610012.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c84610012.filter(c,e,tp)
return c:IsSetCard(0x3a) and bit.band(c:GetType(),0x81)==0x81 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false)
end
function c84610012.tar(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610012.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND)
end
function c84610012.act(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,c84610012.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetOperation(c84610012.retop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetCountLimit(1)
tc:RegisterEffect(e2,true)
end
end
function c84610012.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
function c84610012.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function c84610012.thfilter(c)
return c:IsSetCard(0x3a) and c:IsAbleToHand()
end
function c84610012.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c84610012.thfilter,tp,LOCATION_DECK,0,nil)
return g:GetClassCount(Card.GetCode)>=3
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c84610012.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c84610012.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg2=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg2:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg3=g:Select(tp,1,1,nil)
sg1:Merge(sg2)
sg1:Merge(sg3)
Duel.ConfirmCards(1-tp,sg1)
Duel.ShuffleDeck(tp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tg=sg1:Select(1-tp,1,1,nil)
local tc=tg:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--リチュアの水鏡
function c84610013.initial_effect(c)
c:EnableCounterPermit(0x100)
c:SetCounterLimit(0x100,3)
--link summon
aux.AddLinkProcedure(c,c84610013.matfilter,1,1)
c:EnableReviveLimit()
--get flag
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c84610013.accon)
e1:SetOperation(c84610013.acop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,84610013)
e2:SetCondition(c84610013.ctcon)
e2:SetOperation(c84610013.ctop)
c:RegisterEffect(e2)
--material check
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(c84610013.valcheck)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(84610013,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,84611013)
e4:SetCondition(c84610013.spcon)
e4:SetTarget(c84610013.sptg)
e4:SetOperation(c84610013.spop)
c:RegisterEffect(e4)
--set
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(84610013,1))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,84612013)
e5:SetCondition(c84610013.setcon)
e5:SetTarget(c84610013.settg)
e5:SetOperation(c84610013.setop)
c:RegisterEffect(e5)
--tohand+search
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_MZONE)
e6:SetCost(c84610013.cost)
e6:SetTarget(c84610013.target)
e6:SetOperation(c84610013.operation)
c:RegisterEffect(e6)
end
function c84610013.matfilter(c)
return c:IsLinkSetCard(0x3a) and not c:IsLinkType(TYPE_LINK)
end
function c84610013.accon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c84610013.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL)
and re:GetHandler():GetType()==TYPE_SPELL+TYPE_RITUAL and e:GetHandler():GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(0x100,1)
end
end
function c84610013.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and e:GetLabel()==1
end
function c84610013.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
c:AddCounter(0x100,3)
end
end
function c84610013.mfilter(c)
return bit.band(c:GetType(),0x81)==0x81
end
function c84610013.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(c84610013.mfilter,1,nil) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c84610013.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x3a) and e:GetHandler():GetFlagEffect(1)>0
end
function c84610013.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function c84610013.spfilter(c,e,tp)
return c:IsSetCard(0x3a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsExistingMatchingCard(c84610013.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
end
function c84610013.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610013.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84610013.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,c84610013.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 c84610013.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc~=c and rc:IsSetCard(0x3a) and rc:IsControler(tp) and c:GetFlagEffect(1)>0
end
function c84610013.setfilter(c)
return c:IsSetCard(0x3a) and c:GetType()==TYPE_SPELL+TYPE_RITUAL and c:IsSSetable()
end
function c84610013.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610013.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c84610013.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c84610013.setfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
end
end
function c84610013.filter(c)
return c:IsType(TYPE_RITUAL) and c:IsAbleToHand()
end
function c84610013.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x100,3,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x100,3,REASON_COST)
end
function c84610013.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610013.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84610013.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610013.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--ガスタの巫女 ウィン
function c84610014.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c84610014.matfilter,1,1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCost(c84610014.spcost)
e1:SetCondition(c84610014.spcon)
e1:SetTarget(c84610014.sptg)
e1:SetOperation(c84610014.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_MAIN_END,TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c84610014.spcost2)
e2:SetTarget(c84610014.sptg2)
e2:SetOperation(c84610014.spop2)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c84610014.spcon2)
e3:SetTarget(c84610014.sptg3)
e3:SetOperation(c84610014.spop3)
c:RegisterEffect(e3)
end
function c84610014.matfilter(c)
return c:IsLinkSetCard(0x10) and not c:IsLinkType(TYPE_LINK)
end
function c84610014.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c84610014.cosfilter(c)
return c:IsSetCard(0x10) and c:IsAbleToGraveAsCost()
end
function c84610014.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610014.cosfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c84610014.cosfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_COST)
end
end
function c84610014.spfilter(c,e,tp)
return c:IsSetCard(0x10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610014.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610014.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84610014.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 g=Duel.SelectMatchingCard(tp,c84610014.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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c84610014.splimit)
Duel.RegisterEffect(e1,tp)
end
function c84610014.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x10)
end
function c84610014.rfilter(c,tp)
return c:IsSetCard(0x10) and (c:IsControler(tp) or c:IsFaceup())
end
function c84610014.fselect(c,tp,rg,sg)
sg:AddCard(c)
if sg:GetCount()<2 then
res=rg:IsExists(c84610014.fselect,1,sg,tp,rg,sg)
else
res=c84610014.fgoal(tp,sg)
end
sg:RemoveCard(c)
return res
end
function c84610014.fgoal(tp,sg)
if sg:GetCount()>0 and Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
Duel.SetSelectedCard(sg)
return Duel.CheckReleaseGroup(tp,nil,0,nil)
else return false end
end
function c84610014.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetReleaseGroup(tp):Filter(c84610014.rfilter,nil,tp)
local g=Group.CreateGroup()
if chk==0 then return rg:IsExists(c84610014.fselect,1,nil,tp,rg,g) end
while g:GetCount()<2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:FilterSelect(tp,c84610014.fselect,1,1,g,tp,rg,g)
g:Merge(sg)
end
Duel.Release(g,REASON_COST)
end
function c84610014.scfilter(c,e,tp)
return c:IsSetCard(0x10) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c84610014.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL)
and Duel.IsExistingMatchingCard(c84610014.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c84610014.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84610014.scfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c84610014.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c84610014.spfilter2(c,e,tp)
return c:IsCode(84610014) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false)
end
function c84610014.sptg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610014.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c84610014.spop3(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84610014.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP)
end
end
--妖精伝姫-ストーリー
function c84610015.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c84610015.cost)
e1:SetTarget(c84610015.target)
e1:SetOperation(c84610015.operation)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetOperation(c84610015.posop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--cannot be target
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(c84610015.tglimit)
e4:SetValue(c84610015.tgval)
c:RegisterEffect(e4)
--change effect
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetCost(c84610015.chcost)
e5:SetCondition(c84610015.chcon)
e5:SetTarget(c84610015.chtg)
e5:SetOperation(c84610015.chop)
c:RegisterEffect(e5)
end
function c84610015.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 c84610015.filter(c)
return c:IsAttack(1850) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand() and not c:IsCode(84610015)
end
function c84610015.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610015.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84610015.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610015.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c84610015.posfilter(c)
return (c:IsFaceup() and c:IsCanTurnSet()) or c:IsDefensePos() or c:IsFacedown()
end
function c84610015.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c84610015.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(84610015,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local pcg=Duel.SelectMatchingCard(tp,c84610015.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tg=pcg:GetFirst()
if tg:IsAttackPos() then
Duel.ChangePosition(tg,POS_FACEDOWN_DEFENSE)
e:GetHandler():RegisterFlagEffect(84610015,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
if e:GetHandler():GetFlagEffect(84610015)==0 and (tg:IsDefensePos() or tg:IsFacedown()) then
Duel.ChangePosition(tg,POS_FACEUP_ATTACK)
end
end
end
function c84610015.tglimit(e,c)
return c~=e:GetHandler()
end
function c84610015.tgval(e,re,rp)
return re:IsActiveType(TYPE_MONSTER)
end
function c84610015.chcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c84610015.cfilter(c)
return not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c84610015.chcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c84610015.cfilter,1,e:GetHandler()) end
local g=Duel.SelectReleaseGroup(tp,c84610015.cfilter,1,1,e:GetHandler())
Duel.Release(g,REASON_COST)
end
function c84610015.chfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c84610015.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610015.chfilter,rp,0,LOCATION_MZONE,1,nil) end
end
function c84610015.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c84610015.repop)
end
function c84610015.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c84610015.filter2,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
--EMペンデュラムの魔術師 
function c84610016.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_PENDULUM),2,2)
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--extra pendulum
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84610016,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,84610016)
e1:SetCost(c84610016.expcost)
e1:SetTarget(c84610016.exptg)
e1:SetOperation(c84610016.expop)
c:RegisterEffect(e1)
--pendulum set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84610016,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,84611016)
e2:SetTarget(c84610016.settg)
e2:SetOperation(c84610016.setop)
c:RegisterEffect(e2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,84612016)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c84610016.spcon)
e1:SetCost(c84610016.spcost)
e1:SetTarget(c84610016.sptg)
e1:SetOperation(c84610016.spop)
c:RegisterEffect(e1)
--special summon+tohand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,84613016)
e2:SetCondition(c84610016.tspcon)
e2:SetTarget(c84610016.tsptg)
e2:SetOperation(c84610016.tspop)
c:RegisterEffect(e2)
--pendulum
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c84610016.pencon)
e3:SetTarget(c84610016.pentg)
e3:SetOperation(c84610016.penop)
c:RegisterEffect(e3)
end
c84610016.pendulum_level=4
function c84610016.filter(c)
return c:IsType(TYPE_PENDULUM) and c:IsFaceup() and c:IsAbleToDeckAsCost()
end
function c84610016.expcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610016.filter,tp,LOCATION_EXTRA,0,10,nil) end
local g=Duel.GetMatchingGroup(c84610016.filter,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()<10 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,10,10,nil)
Duel.SendtoDeck(sg,nil,0,REASON_COST)
end
function c84610016.exptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c84610016.expop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84610016,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c84610016.setfilter1(c,tp)
return c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
and Duel.IsExistingMatchingCard(c84610016.setfilter2,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c84610016.setfilter2(c,code)
return not c:IsCode(code) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function c84610016.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local sc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c84610016.setfilter1,tp,LOCATION_DECK,0,1,nil,tp) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function c84610016.setop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
if g:GetCount()<2 then return end
if Duel.Destroy(g,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g1=Duel.SelectMatchingCard(tp,c84610016.setfilter1,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc1=g1:GetFirst()
if not tc1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g2=Duel.SelectMatchingCard(tp,c84610016.setfilter2,tp,LOCATION_DECK,0,1,1,nil,tc1:GetCode())
local tc2=g2:GetFirst()
if Duel.MoveToField(tc1,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
if Duel.MoveToField(tc2,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
tc2:SetStatus(STATUS_EFFECT_ENABLED,true)
end
tc1:SetStatus(STATUS_EFFECT_ENABLED,true)
end
end
end
function c84610016.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldCard(tp,LOCATION_PZONE,0) and Duel.GetFieldCard(tp,LOCATION_PZONE,1)
end
function c84610016.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function c84610016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,LOCATION_PZONE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,LOCATION_EXTRA)
end
function c84610016.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,LOCATION_PZONE)
if not c:IsRelateToEffect(e) then return end
if Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.SpecialSummon(c,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP)
c:CompleteProcedure()
end
end
function c84610016.tspcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) or e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c84610016.spfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c84610016.thfilter,tp,LOCATION_EXTRA,0,1,c)
end
function c84610016.thfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c84610016.tsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610016.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c84610016.tspop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c84610016.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if sg:GetCount()>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c84610016.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if tg:GetCount()>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
end
end
function c84610016.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
end
function c84610016.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 c84610016.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--マドルチェ・グランセスール
function c84610019.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,84610019)
e1:SetTarget(c84610019.sumtg)
e1:SetOperation(c84610019.sumop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--tohand+search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,84611019)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e3:SetCost(c84610019.cost)
e3:SetTarget(c84610019.target)
e3:SetOperation(c84610019.operation)
c:RegisterEffect(e3)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c84610019.retcon)
e3:SetTarget(c84610019.rettg)
e3:SetOperation(c84610019.retop)
c:RegisterEffect(e3)
end
function c84610019.sumfilter(c)
return c:IsSetCard(0x71) and not c:IsCode(84610019) and c:IsSummonable(true,nil)
end
function c84610019.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610019.sumfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c84610019.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c84610019.sumfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-1)
tc:RegisterEffect(e1)
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(c84610019.splimit)
Duel.RegisterEffect(e2,tp)
end
function c84610019.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x71)
end
function c84610019.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c84610019.filter(c)
return c:IsSetCard(0x71) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c84610019.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610019.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84610019.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c84610019.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode())
if g:GetCount()>0 and Duel.SelectYesNo(tp,210) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg2=g:Select(tp,1,1,nil)
sg1:Merge(sg2)
end
ct=Duel.SendtoHand(sg1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg1)
if ct>0 then
local tg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if tg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
end
end
end
function c84610019.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetReasonPlayer()==1-tp
and e:GetHandler():GetPreviousControler()==tp
end
function c84610019.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c84610019.retop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)
end
end
--先史遺産フライベルク・スカル
function c84610020.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c84610020.sumtg)
e1:SetOperation(c84610020.sumop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_SPSUM_PARAM)
e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(POS_FACEUP_DEFENSE,0)
e2:SetCondition(c84610020.hspcon)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c84610020.target)
e3:SetOperation(c84610020.operation)
c:RegisterEffect(e3)
end
function c84610020.sumfilter(c)
return c:IsSetCard(0x70) and not c:IsCode(84610020) and c:IsSummonable(true,nil)
end
function c84610020.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610020.sumfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c84610020.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c84610020.sumfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c84610020.splimit)
Duel.RegisterEffect(e1,tp)
end
function c84610020.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_ROCK))
end
function c84610020.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x70)
end
function c84610020.hspcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610020.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c84610020.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function c84610020.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--魔法少女たちの夢
function c84610021.initial_effect(c)
--tohand+search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c84610021.cost)
e1:SetTarget(c84610021.target)
e1:SetOperation(c84610021.activate)
c:RegisterEffect(e1)
end
function c84610021.cfilter(c)
return (c:IsSetCard(0x3a) or c:IsSetCard(0x10) or (c:IsAttack(1850) and c:IsRace(RACE_SPELLCASTER)) or c:IsSetCard(0x98)) and c:IsDiscardable()
end
function c84610021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610021.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c84610021.cfilter,1,1,REASON_DISCARD+REASON_COST,nil)
end
function c84610021.thfilter(c)
return (c:IsCode(84610012) or c:IsCode(84610002) or c:IsCode(84610004) or c:IsCode(84610005))and c:IsAbleToHand()
end
function c84610021.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610021.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c84610021.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610021.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
ct=Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if ct>0 then
local g2=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(84610021,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=g2:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
if tc:IsImmuneToEffect(e) then return false end
Duel.Destroy(tc,REASON_RULE)
end
end
end
--妖精伝姫-禁断の書
function c84610022.initial_effect(c)
--autoaction
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_PREDRAW)
e0:SetRange(LOCATION_DECK)
e0:SetCountLimit(1,84610022+EFFECT_COUNT_CODE_DUEL)
e0:SetOperation(c84610022.autoop)
c:RegisterEffect(e0)
--inactivatable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetRange(LOCATION_ONFIELD)
e1:SetValue(c84610022.effectfilter)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
e2:SetRange(LOCATION_ONFIELD)
e2:SetValue(c84610022.effectfilter)
c:RegisterEffect(e2)
--tohand+search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c84610022.activate)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c84610022.indestg)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--Action
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(84610022,2))
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_FZONE)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetTarget(c84610022.tdtg)
e4:SetOperation(c84610022.tdop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetDescription(aux.Stringid(84610022,3))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetTarget(c84610022.target)
e5:SetOperation(c84610022.operation)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetDescription(aux.Stringid(84610022,4))
e6:SetCategory(CATEGORY_POSITION)
e6:SetTarget(c84610022.target2)
e6:SetOperation(c84610022.activate2)
c:RegisterEffect(e6)
local e7=e4:Clone()
e7:SetDescription(aux.Stringid(84610022,6))
e7:SetCategory(CATEGORY_REMOVE)
e7:SetTarget(c84610022.remtg)
e7:SetOperation(c84610022.remop)
c:RegisterEffect(e7)
end
function c84610022.rfilter(c)
return c:IsCode(84610022)
end
function c84610022.spfilter(c,e,tp)
return c:IsAttack(1850) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610022.autoop(e,tp,eg,ep,ev,re,r,rp,chk)
local dc=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.ShuffleDeck(tp)
--local ht1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
--if ht1<5 then
--Duel.Draw(tp,5-ht1,REASON_RULE)
--end
--local ht1=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
--if ht1<5 then
--Duel.Draw(1-tp,5-ht1,REASON_RULE)
--end
local fg=Duel.GetMatchingGroup(c84610022.spfilter,tp,LOCATION_DECK,0,nil,e,tp,false,false)
if fg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(84610022,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=fg:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function c84610022.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return tc:IsRace(RACE_SPELLCASTER)
end
function c84610022.thfilter(c)
return c:IsAttack(1850) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
end
function c84610022.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c84610022.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(84610022,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c84610022.indestg(e,c)
return c:IsRace(RACE_SPELLCASTER)
end
function c84610022.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():GetFlagEffect(84610022)==0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_REMOVED)
c:RegisterFlagEffect(84610022,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c84610022.tdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
function c84610022.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c84610022.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():GetFlagEffect(84610022)==0 and Duel.IsExistingMatchingCard(c84610022.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
c:RegisterFlagEffect(84610022,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c84610022.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610022.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c84610022.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c84610022.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function c84610022.filter2(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c84610022.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():GetFlagEffect(84610022)==0 and Duel.IsExistingMatchingCard(c84610022.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c84610022.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
c:RegisterFlagEffect(84610022,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c84610022.filter3(c)
return not c:IsPosition(POS_FACEUP_ATTACK)
end
function c84610022.activate2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,c84610022.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
if tc:IsPosition(POS_FACEUP) then
pc=Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
if pc>0 then
local fg=Duel.GetMatchingGroup(c84610022.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if fg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(84610022,5)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,c84610022.filter3,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
if tc:IsPosition(POS_FACEUP_DEFENSE+POS_FACEDOWN_DEFENSE) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
end
end
end
end
function c84610022.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():GetFlagEffect(84610022)==0
and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_IRON_WALL)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_DECK+LOCATION_EXTRA)
c:RegisterFlagEffect(84610022,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c84610022.remop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK+LOCATION_EXTRA)
Duel.ConfirmCards(tp,g)
local tg=g:Filter(Card.IsCode,nil,sg:GetFirst():GetCode())
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
end
end
--究極壊獣アンノウン
function c84610023.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
--auto Pset
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,84610023)
e1:SetCondition(c84610023.setcon)
e1:SetTarget(c84610023.settg)
e1:SetOperation(c84610023.setop)
c:RegisterEffect(e1)
--unaffectable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetValue(c84610023.efilter)
c:RegisterEffect(e3)
--token
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_PZONE)
e4:SetCountLimit(1)
e4:SetCondition(c84610023.setcon)
e4:SetTarget(c84610023.sptg)
e4:SetOperation(c84610023.spop)
c:RegisterEffect(e4)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(84610023,0))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetRange(LOCATION_PZONE)
e5:SetCountLimit(1)
e5:SetTarget(c84610023.hsptg)
e5:SetOperation(c84610023.hspop)
c:RegisterEffect(e5)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--control
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_START)
e2:SetCondition(c84610023.ctcon)
e2:SetTarget(c84610023.cttg)
e2:SetOperation(c84610023.ctop)
c:RegisterEffect(e2)
--unaffectable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c84610023.indestg)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(c84610023.efilter)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_SUM)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e6)
end
function c84610023.setcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c84610023.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,2,nil) end
end
function c84610023.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function c84610023.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c84610023.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,0,0)
end
function c84610023.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
local ct=ft
if ct>0 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
if ct>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,84610024,0,0,0,0,11,RACE_ALL,ATTRIBUTE_ALL,POS_FACEUP_DEFENSE,1-tp) then
for i=1,ct do
local token=Duel.CreateToken(tp,84610024)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
Duel.SpecialSummonComplete()
end
end
function c84610023.hspfilter(c)
return c:IsSetCard(0xd3) and c:IsReleasableByEffect() and c:IsFaceup()
end
function c84610023.relfilter(c)
return c:IsReleasableByEffect()
end
function c84610023.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c84610023.relfilter,tp,0,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>1 and g:IsExists(c84610023.hspfilter,1,nil,tp)
and Duel.GetMZoneCount(1-tp,g)>0 and Duel.IsPlayerCanRelease(tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84610023.spfilter(c,e,tp)
return c:IsSetCard(0xd3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610023.spcheck(g)
return g:GetClassCount(Card.GetCode)==#g
end
function c84610023.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local rg=Duel.GetMatchingGroup(c84610023.relfilter,tp,0,LOCATION_MZONE,nil)
if rg:GetCount()>1 and rg:IsExists(c84610023.hspfilter,1,nil,tp) and Duel.Release(rg,REASON_EFFECT) then
local og=Duel.GetOperatedGroup()
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,1-tp,true,true,POS_FACEUP)>0 then
if og:GetCount()>0 then
Duel.BreakEffect()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=og:GetCount()
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
if ct>ft then ct=ft end
if ft>0 then
local g=Duel.GetMatchingGroup(c84610023.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c84610023.spcheck,false,1,ct)
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)
tc=sg:GetNext()
end
end
end
Duel.SpecialSummonComplete()
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
local ct=og:GetCount()
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
if ct>ft then ct=ft end
if ft>0 then
local g=Duel.GetMatchingGroup(c84610023.spfilter,1-tp,LOCATION_DECK,0,nil,e,1-tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(1-tp,c84610023.spcheck,false,1,ct)
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP_ATTACK)
tc=sg:GetNext()
end
end
end
Duel.SpecialSummonComplete()
end
end
end
end
function c84610023.ctcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
return Duel.GetAttacker():IsControler(1-tp) and at:IsControler(tp) and at:IsFaceup() and at:IsCode(84610023)
end
function c84610023.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetAttackTarget()
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,0,0)
end
function c84610023.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if not (c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0) or not (tc:IsAbleToChangeControler() and Duel.GetMZoneCount(1-tp,tc,1-tp,LOCATION_REASON_CONTROL)>0)
then return end
if c:IsRelateToEffect(e) then
Duel.SwapControl(c,tc,0,0)
end
end
function c84610023.indestg(e,c)
return c:IsSetCard(0xd3) and c:IsType(TYPE_MONSTER)
end
function c84610023.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
--壊星壊獣ジズキエル
function c84610025.initial_effect(c)
c:SetUniqueOnField(1,0,c84610025.uqfilter,LOCATION_MZONE)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,1)
e1:SetCondition(c84610025.spcon)
e1:SetOperation(c84610025.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK,0)
e2:SetCondition(c84610025.spcon2)
c:RegisterEffect(e2)
--Negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84610025,0))
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c84610025.discon)
e3:SetCost(c84610025.discost)
e3:SetTarget(c84610025.distg)
e3:SetOperation(c84610025.disop)
c:RegisterEffect(e3)
end
function c84610025.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610025.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610025.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610025)
else
return c:IsSetCard(0xd3)
end
end
function c84610025.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function c84610025.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610025.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function c84610025.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c84610025.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c84610025.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd3)
end
function c84610025.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610025.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c84610025.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:GetCount()==1 and Duel.IsChainDisablable(ev)
end
function c84610025.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x37,3,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x37,3,REASON_COST)
end
function c84610025.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c84610025.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if Duel.NegateEffect(ev) and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(63941210,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tg=g:Select(tp,1,1,nil)
Duel.HintSelection(tg)
Duel.Destroy(tg,REASON_EFFECT)
end
end
--雷撃壊獣サンダー・ザ・キング
function c84610026.initial_effect(c)
c:SetUniqueOnField(1,0,c84610026.uqfilter,LOCATION_MZONE)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,1)
e1:SetCondition(c84610026.spcon)
e1:SetOperation(c84610026.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK,0)
e2:SetCondition(c84610026.spcon2)
c:RegisterEffect(e2)
--multi attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c84610026.atkcon)
e3:SetCost(c84610026.atkcost)
e3:SetOperation(c84610026.atkop)
c:RegisterEffect(e3)
end
function c84610026.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610026.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610026.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610026)
else
return c:IsSetCard(0xd3)
end
end
function c84610026.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function c84610026.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610026.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function c84610026.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c84610026.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c84610026.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd3)
end
function c84610026.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610026.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c84610026.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c84610026.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x37,3,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x37,3,REASON_COST)
end
function c84610026.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if c:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e2:SetValue(2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
--対壊獣用決戦兵器メカサンダー・キング
function c84610027.initial_effect(c)
c:SetUniqueOnField(1,0,c84610027.uqfilter,LOCATION_MZONE)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84610027,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c84610027.spcon)
e1:SetCost(c84610027.spcost)
e1:SetTarget(c84610027.sptg)
e1:SetOperation(c84610027.spop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(c84610027.indval)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetValue(c84610027.efilter)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(84610027,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,84610027+EFFECT_COUNT_CODE_DUEL)
e4:SetCondition(c84610027.spcon2)
e4:SetTarget(c84610027.sptg2)
e4:SetOperation(c84610027.spop2)
c:RegisterEffect(e4)
end
function c84610027.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610027.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610027.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610027)
else
return c:IsSetCard(0xd3)
end
end
function c84610027.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c84610027.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c84610027.rmfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xd3) and c:IsAbleToRemove() and c:GetOwner()==1-tp
end
function c84610027.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610027.rmfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE)
end
function c84610027.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c84610027.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c84610027.rmfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c84610027.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(84610027,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c84610027.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c84610027.indval(e,c)
return c:IsSetCard(0xd3)
end
function c84610027.efilter(e,te)
return te:GetHandler():IsSetCard(0xd3)
end
function c84610027.spcon2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c84610027.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c84610027.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--怒炎壊獣ドゴラン
function c84610028.initial_effect(c)
c:SetUniqueOnField(1,0,c84610028.uqfilter,LOCATION_MZONE)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,1)
e1:SetCondition(c84610028.spcon)
e1:SetOperation(c84610028.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK,0)
e2:SetCondition(c84610028.spcon2)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c84610028.descost)
e3:SetTarget(c84610028.destg)
e3:SetOperation(c84610028.desop)
c:RegisterEffect(e3)
end
function c84610028.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610028.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610028.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610028)
else
return c:IsSetCard(0xd3)
end
end
function c84610028.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function c84610028.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610028.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function c84610028.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c84610028.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c84610028.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd3)
end
function c84610028.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610028.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c84610028.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x37,3,REASON_COST)
and e:GetHandler():GetAttackAnnouncedCount()==0 end
Duel.RemoveCounter(tp,1,1,0x37,3,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c84610028.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end
local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c84610028.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
Duel.Destroy(g,REASON_EFFECT)
end
--怪粉壊獣ガダーラ
function c84610029.initial_effect(c)
c:SetUniqueOnField(1,0,c84610029.uqfilter,LOCATION_MZONE)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,1)
e1:SetCondition(c84610029.spcon)
e1:SetOperation(c84610029.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK,0)
e2:SetCondition(c84610029.spcon2)
c:RegisterEffect(e2)
--Halve ATK
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMINGS_CHECK_MONSTER)
e3:SetCountLimit(1)
e3:SetCondition(c84610029.atkcon)
e3:SetCost(c84610029.atkcost)
e3:SetTarget(c84610029.atktg)
e3:SetOperation(c84610029.atkop)
c:RegisterEffect(e3)
end
function c84610029.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610029.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610029.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610029)
else
return c:IsSetCard(0xd3)
end
end
function c84610029.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function c84610029.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610029.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function c84610029.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c84610029.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c84610029.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd3)
end
function c84610029.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610029.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c84610029.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c84610029.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x37,3,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x37,3,REASON_COST)
end
function c84610029.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
end
function c84610029.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
local tc=tg:GetFirst()
while tc do
local atk=tc:GetAttack()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk/2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(def/2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
tc=tg:GetNext()
end
end
--海亀壊獣ガメシエル
function c84610030.initial_effect(c)
c:SetUniqueOnField(1,0,c84610030.uqfilter,LOCATION_MZONE)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,1)
e1:SetCondition(c84610030.spcon)
e1:SetOperation(c84610030.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK,0)
e2:SetCondition(c84610030.spcon2)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c84610030.negcon)
e3:SetCost(c84610030.negcost)
e3:SetTarget(c84610030.negtg)
e3:SetOperation(c84610030.negop)
c:RegisterEffect(e3)
end
function c84610030.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610030.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610030.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610030)
else
return c:IsSetCard(0xd3)
end
end
function c84610030.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function c84610030.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610030.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function c84610030.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c84610030.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c84610030.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd3)
end
function c84610030.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610030.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c84610030.negcon(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return not re:GetHandler():IsCode(55063751) and Duel.IsChainNegatable(ev)
end
function c84610030.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x37,2,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x37,2,REASON_COST)
end
function c84610030.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.nbcon(tp,re) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function c84610030.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
--対壊獣用決戦兵器スーパーメカドゴラン
function c84610031.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,0,c84610031.uqfilter,LOCATION_MZONE)
--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:SetCondition(c84610031.spcon)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c84610031.eqcost)
e2:SetTarget(c84610031.eqtg)
e2:SetOperation(c84610031.eqop)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c84610031.atkval)
c:RegisterEffect(e3)
end
function c84610031.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610031.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610031.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610031)
else
return c:IsSetCard(0xd3)
end
end
function c84610031.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd3)
end
function c84610031.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610031.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c84610031.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x37,2,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x37,2,REASON_COST)
end
function c84610031.eqfilter(c)
return c:IsSetCard(0xd3) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c84610031.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c84610031.eqfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c84610031.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c84610031.eqfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if not Duel.Equip(tp,tc,c,true) then return end
tc:RegisterFlagEffect(84610031,RESET_EVENT+RESETS_STANDARD,0,0)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c84610031.eqlimit)
tc:RegisterEffect(e1)
end
end
function c84610031.eqlimit(e,c)
return e:GetOwner()==c
end
function c84610031.atkfilter(c)
return c:IsSetCard(0xd3) and c:GetAttack()>=0 and c:GetFlagEffect(84610031)~=0
end
function c84610031.atkval(e,c)
local g=e:GetHandler():GetEquipGroup():Filter(c84610031.atkfilter,nil)
return g:GetSum(Card.GetAttack)
end
--多次元壊獣ラディアン
function c84610032.initial_effect(c)
c:SetUniqueOnField(1,0,c84610032.uqfilter,LOCATION_MZONE)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,1)
e1:SetCondition(c84610032.spcon)
e1:SetOperation(c84610032.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK,0)
e2:SetCondition(c84610032.spcon2)
c:RegisterEffect(e2)
--token
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c84610032.tkcost)
e3:SetTarget(c84610032.tktg)
e3:SetOperation(c84610032.tkop)
c:RegisterEffect(e3)
end
function c84610032.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610032.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610032.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610032)
else
return c:IsSetCard(0xd3)
end
end
function c84610032.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function c84610032.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610032.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function c84610032.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c84610032.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c84610032.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd3)
end
function c84610032.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610032.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c84610032.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x37,2,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x37,2,REASON_COST)
end
function c84610032.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,84610032,0,0x4011,2800,0,7,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c84610032.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,84610032,0,0x4011,2800,0,7,RACE_FIEND,ATTRIBUTE_DARK) then return end
local token=Duel.CreateToken(tp,84610032)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
token:RegisterEffect(e1,true)
end
--粘糸壊獣クモグス
function c84610033.initial_effect(c)
c:SetUniqueOnField(1,0,c84610033.uqfilter,LOCATION_MZONE)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,1)
e1:SetCondition(c84610033.spcon)
e1:SetOperation(c84610033.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK,0)
e2:SetCondition(c84610033.spcon2)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c84610033.cost)
e3:SetTarget(c84610033.target)
e3:SetOperation(c84610033.operation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function c84610033.unlimfilter(c,tp)
return c:IsCode(84610023) and c:IsFaceup()
end
function c84610033.uqfilter(c)
if Duel.IsExistingMatchingCard(c84610033.unlimfilter,tp,LOCATION_MZONE+LOCATION_PZONE,LOCATION_MZONE+LOCATION_PZONE,1,nil,tp) then
return c:IsCode(84610033)
else
return c:IsSetCard(0xd3)
end
end
function c84610033.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function c84610033.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c84610033.spfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function c84610033.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c84610033.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c84610033.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd3)
end
function c84610033.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610033.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c84610033.filter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup()
end
function c84610033.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x37,2,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x37,2,REASON_COST)
end
function c84610033.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c84610033.filter,1,nil,1-tp) and not eg:IsContains(e:GetHandler()) end
local g=eg:Filter(c84610033.filter,nil,1-tp)
Duel.SetTargetCard(g)
end
function c84610033.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e3)
tc=g:GetNext()
end
end
--影依の再誕 リバース
function c84610034.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c84610034.matfilter,1,1)
c:EnableReviveLimit()
--not act
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_ACTIVATE)
e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(0,1)
e0:SetCondition(c84610034.econ)
e0:SetValue(c84610034.actval)
c:RegisterEffect(e0)
--to grave and todeck or spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c84610034.target)
e1:SetOperation(c84610034.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c84610034.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--change pos
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84610034,0))
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c84610034.chtg)
e3:SetOperation(c84610034.chop)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(84610034,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,84610034)
e4:SetTarget(c84610034.settg)
e4:SetOperation(c84610034.setop)
c:RegisterEffect(e4)
end
function c84610034.matfilter(c)
return c:IsLinkSetCard(0x9d) and not c:IsLinkType(TYPE_LINK)
end
function c84610034.efilter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsSetCard(0x9d)
end
function c84610034.econ(e)
return Duel.IsExistingMatchingCard(c84610034.efilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,3,nil)
end
function c84610034.actval(e,re,rp)
local g=Duel.GetMatchingGroup(c84610034.efilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>3 then return end
local tc=g:GetFirst()
local c=re:GetHandler()
if tc then
tc1=g:GetNext()
tc2=g:GetNext()
end
return re:IsActiveType(TYPE_MONSTER) and (c:IsAttribute(tc:GetAttribute())
or c:IsAttribute(tc1:GetAttribute()) or c:IsAttribute(tc2:GetAttribute()))
end
function c84610034.gfilter(c)
return c:IsSetCard(0x9d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c84610034.tfilter(c)
return c:IsSetCard(0x9d) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c84610034.spfilter(c,e,tp)
return c:IsSetCard(0x9d) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610034.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610034.gfilter,tp,LOCATION_DECK,0,1,nil)
and (Duel.IsExistingMatchingCard(c84610034.tfilter,tp,LOCATION_GRAVE,0,1,nil)
or (e:GetLabel()==1 and Duel.IsExistingMatchingCard(c84610034.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp))) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK)
end
function c84610034.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c84610034.gfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
ct=Duel.SendtoGrave(g,REASON_EFFECT)
end
s=0
if ct>0 and e:GetLabel()==1 and Duel.GetFlagEffect(tp,84610034)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(84610034,2)) then
local tg=Duel.GetMatchingGroup(c84610034.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp,false,false)
if tg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=tg:Select(tp,1,1,nil)
s=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.RegisterFlagEffect(tp,84610034,RESET_PHASE+PHASE_END,0,1)
end
end
if ct>0 and s~=1 then
local tg=Duel.GetMatchingGroup(c84610034.tfilter,tp,LOCATION_GRAVE,0,nil,e,tp,false,false)
if tg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=tg:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetValue(c84610034.limval)
Duel.RegisterEffect(e1,tp)
end
function c84610034.limval(e,re,rp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and re:GetActivateLocation()==LOCATION_MZONE
and not rc:IsSetCard(0x9d) and not rc:IsImmuneToEffect(e)
end
function c84610034.mfilter(c)
return c:IsType(TYPE_FUSION)
end
function c84610034.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(c84610034.mfilter,1,nil) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c84610034.cmfilter(c)
return c:IsFaceup() and c:IsSetCard(0x9d)
end
function c84610034.chfilter(c)
return (not c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanChangePosition()) or c:IsCanTurnSet()
end
function c84610034.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610034.cmfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c84610034.chfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c84610034.chfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c84610034.chop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c84610034.cmfilter,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(c84610034.chfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local ct=5
ct=math.min(ct,g1:GetCount())
if ct>0 and g2:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tg=g2:Select(tp,1,ct,nil)
local tc=tg:GetFirst()
while tc do
if tc:IsAttackPos() then
local pos=0
if tc:IsCanTurnSet() then
pos=Duel.SelectPosition(tp,tc,POS_DEFENSE)
else
pos=Duel.SelectPosition(tp,tc,POS_FACEUP_DEFENSE)
end
Duel.ChangePosition(tc,pos)
else
Duel.ChangePosition(tc,0,0,POS_FACEDOWN_DEFENSE,POS_FACEUP_DEFENSE)
end
tc=tg:GetNext()
end
end
end
function c84610034.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x9d) and c:IsSSetable()
end
function c84610034.setcheck(g)
return g:GetClassCount(Card.GetCode)==#g
end
function c84610034.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c84610034.efilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return g:GetCount()>1
and Duel.IsExistingMatchingCard(c84610034.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
end
function c84610034.setop(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(c84610034.efilter,tp,LOCATION_MZONE,0,nil)
local ct=cg:GetClassCount(Card.GetCode)
if ct==0 then return end
local g=Duel.GetMatchingGroup(c84610034.setfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:SelectSubGroup(tp,c84610034.setcheck,false,1,ct)
local tc=sg:GetFirst()
while tc do
Duel.SSet(tp,tc)
tc=sg:GetNext()
end
end
end
--霊術使いヒダウアラエ
function c84610035.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,2,c84610035.lcheck)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SPSUMMON)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c84610035.sptg)
e1:SetOperation(c84610035.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c84610035.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84610035,0))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c84610035.sumtg)
e3:SetOperation(c84610035.sumop)
c:RegisterEffect(e3)
--spsummon
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(84610035,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetTarget(c84610035.sptg2)
e4:SetOperation(c84610035.spop2)
c:RegisterEffect(e4)
--change pos
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(84610035,2))
e5:SetCategory(CATEGORY_POSITION)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e5:SetTarget(c84610035.chtg)
e5:SetOperation(c84610035.chop)
c:RegisterEffect(e5)
--atk up
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(c84610035.atkcon)
e5:SetOperation(c84610035.atkop)
c:RegisterEffect(e5)
end
function c84610035.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84610035.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetLabel()==1
and Duel.IsExistingMatchingCard(c84610035.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c84610035.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,c84610035.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c84610035.lcheck(g,lc)
return g:IsExists(Card.IsLinkRace,1,nil,RACE_SPELLCASTER)
end
function c84610035.valcheck(e,c)
local g=c:GetMaterial()
local tc1=g:GetFirst()
local tc2=g:GetNext()
if tc1:GetOwner()~=e:GetHandlerPlayer() or tc2:GetOwner()~=e:GetHandlerPlayer() then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c84610035.tfilter(c,att,e,tp,tc)
return c:IsSetCard(0xbf) and not c:IsAttribute(att) and c:IsSummonable(true,nil)
end
function c84610035.sumfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsPublic() and Duel.IsExistingMatchingCard(c84610035.tfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,c:GetAttribute(),e,tp,c)
end
function c84610035.f(c,att)
return not c:IsPublic() and not (c:GetAttribute()&att)==att
end
function c84610035.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(846100351)==0
and Duel.IsExistingTarget(c84610035.sumfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectTarget(tp,c84610035.sumfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
e:SetLabel(g:GetFirst():GetAttribute())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RegisterFlagEffect(846100351,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c84610035.sumop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local att=tc:GetAttribute()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c84610035.tfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,att,e,tp,nil)
local sc=g:GetFirst()
if sc then
Duel.Summon(tp,sc,true,nil)
end
end
function c84610035.tfilter2(c,att,e,tp,tc)
return c:IsSetCard(0xbf) and c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c84610035.spfilter2(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsPublic() and Duel.IsExistingMatchingCard(c84610035.tfilter2,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,c:GetAttribute(),e,tp,c)
end
function c84610035.chkfilter2(c,att)
return not c:IsPublic() and no (c:GetAttribute()&att)==att
end
function c84610035.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(846100351)==0
and Duel.IsExistingTarget(c84610035.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectTarget(tp,c84610035.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
e:SetLabel(g:GetFirst():GetAttribute())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RegisterFlagEffect(846100351,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c84610035.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local att=tc:GetAttribute()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84610035.tfilter2,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,att,e,tp,nil)
local sc=g:GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sc)
end
end
function c84610035.chfilter(c)
return (not c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanChangePosition()) or c:IsCanTurnSet() and c:IsLocation(LOCATION_MZONE)
end
function c84610035.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c84610035.chfilter,tp,LOCATION_MZONE,0,1,nil) end
if not Duel.CheckPhaseActivity() then e:SetLabel(1) else e:SetLabel(0) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c84610035.chfilter,tp,LOCATION_MZONE,0,1,99,nil)
e:SetLabelObject(g)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c84610035.cmfilter(c)
return c:IsFaceup() and (c:IsSetCard(0xbf) or c:IsSetCard(0x10c0))
end
function c84610035.sfilter(c,tp)
return (c:IsCode(38057522) and c:GetActivateEffect():IsActivatable(tp,true,true))
or (c:IsCode(62256492,25704359) and c:GetActivateEffect():IsActivatable(tp))
or (c:IsCode(5037726,6540606,38167722,42945701,70156997,79333300,91530236,65046521) and c:IsSSetable())
end
function c84610035.scheck(g)
return g:GetClassCount(Card.GetCode)==#g
end
function c84610035.chop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c84610035.chfilter,nil,e,tp)
local sc=e:GetLabelObject()
if tg:GetCount()==0 and tg:GetCount()~=sc:GetCount() then return false end
local tc=tg:GetFirst()
local sumcount=0
while tc do
if tc:IsAttackPos() then
local pos=0
if tc:IsCanTurnSet() then
pos=Duel.SelectPosition(tp,tc,POS_DEFENSE)
else
pos=Duel.SelectPosition(tp,tc,POS_FACEUP_DEFENSE)
end
count=Duel.ChangePosition(tc,pos)
else
count=Duel.ChangePosition(tc,0,0,POS_FACEDOWN_DEFENSE,POS_FACEUP_DEFENSE)
end
tc=tg:GetNext()
sumcount=sumcount+count
end
local g1=Duel.GetMatchingGroup(c84610035.cmfilter,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(c84610035.sfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,nil,tp)
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)+1
ct=math.min(ct,g1:GetCount())
if ct>0 and g2:GetCount()>0 and sumcount>0
and Duel.GetFlagEffect(tp,84610035)==0 and Duel.SelectYesNo(tp,aux.Stringid(84610035,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(84610035,4))
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,15248873,RESET_CHAIN,0,1) end
local se=g2:SelectSubGroup(tp,c84610035.scheck,false,1,ct)
Duel.ResetFlagEffect(tp,15248873)
local sel=se:GetFirst()
while sel do
if sel:GetType()==0x80002 then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(sel,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=sel:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=sel:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(sel,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
if sel:GetType()==0x20002 or sel:GetType()==0x20004 then
Duel.MoveToField(sel,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=sel:GetActivateEffect()
local tep=sel:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end
if sel:GetType()==0x4 then
Duel.SSet(tp,sel)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sel:RegisterEffect(e1)
end
if sel:GetType()==0x10002 then
Duel.SSet(tp,sel)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sel:RegisterEffect(e1)
end
sel=se:GetNext()
end
Duel.RegisterFlagEffect(tp,84610035,RESET_PHASE+PHASE_END,0,1)
end
end
function c84610035.egfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10c0) and c:IsPreviousLocation(LOCATION_DECK)
end
function c84610035.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function c84610035.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c84610035.egfilter,1,nil)
end
function c84610035.atkop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(c84610035.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=tg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=tg:GetNext()
end
end
--全土滅殺 転生波
function c84610036.initial_effect(c)
aux.AddCodeList(c,6007213,32491822,69890967)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84610036,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,84610036+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c84610036.target)
e1:SetOperation(c84610036.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_DECK)
e2:SetCondition(c84610036.deckcon)
e2:SetTarget(c84610036.decktarget)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(84610036,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,846100361+EFFECT_COUNT_CODE_OATH)
e3:SetTarget(c84610036.sptg)
e3:SetOperation(c84610036.spop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetRange(LOCATION_DECK)
e4:SetCondition(c84610036.deckcon)
e4:SetTarget(c84610036.decksptg)
c:RegisterEffect(e4)
--armityle
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,84610036)
e5:SetCondition(c84610036.armcon)
e5:SetCost(aux.bfgcost)
e5:SetTarget(c84610036.armtg)
e5:SetOperation(c84610036.armop)
c:RegisterEffect(e5)
--immune
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_GRAVE)
e6:SetCost(aux.bfgcost)
e6:SetCondition(c84610036.imcon)
e6:SetTarget(c84610036.imtg)
e6:SetOperation(c84610036.imop)
c:RegisterEffect(e6)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetRange(LOCATION_DECK)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetTarget(c84610036.actarget)
e4:SetOperation(c84610036.costop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC_G)
e5:SetRange(LOCATION_DECK)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
c:RegisterEffect(e5)
end
function c84610036.deckfilter(c)
return c:IsOriginalCodeRule(6007213,32491822,69890967) and c:IsFaceup()
end
function c84610036.deckcon(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(c84610036.deckfilter,tp,LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>=1
end
function c84610036.filter(c)
return (c:IsCode(6007213,32491822,69890967) or ((aux.IsCodeListed(c,6007213) or aux.IsCodeListed(c,32491822) or aux.IsCodeListed(c,69890967)))
and not c:IsCode(84610036)) and c:IsAbleToHand()
end
function c84610036.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610036.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610036.decktarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c84610036.filter,tp,LOCATION_DECK,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610036.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84610036.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,6007213,32491822,69890967,43378048))
e1:SetValue(c84610036.ifilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c84610036.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function c84610036.spfilter(c,e,tp)
return c:IsCode(6007213,32491822,69890967) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and not Duel.IsExistingMatchingCard(c84610036.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
end
function c84610036.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84610036.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610036.decksptg(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 Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c84610036.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c84610036.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,c84610036.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,6007213,32491822,69890967,43378048))
e1:SetValue(c84610036.ifilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c84610036.ifilter(e,re)
return re:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function c84610036.confilter(c)
return c:IsOriginalCodeRule(43378048) and c:IsFaceup()
end
function c84610036.armcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c84610036.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c84610036.mfilter(c)
return c:IsType(TYPE_MONSTER)
end
function c84610036.armtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84610036.mfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function c84610036.armop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(84610036,2))
local g=Duel.SelectMatchingCard(tp,c84610036.mfilter,tp,0,LOCATION_MZONE,1,1,nil)
local sc=g:GetFirst()
if sc:IsImmuneToEffect(e) then return false end
if sc:IsAttackPos() then
local atk=sc:GetAttack()
if atk<10001 then
local dmg=10000-atk
Duel.Damage(1-tp,dmg,REASON_BATTLE)
Duel.Destroy(sc,REASON_RULE)
end
else
if sc:IsFacedown() then
Duel.ChangePosition(sc,0,0,POS_FACEUP_DEFENSE)
end
local def=sc:GetDefense()
if def<10000 then
Duel.Destroy(sc,REASON_RULE)
end
end
end
function c84610036.imcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c84610036.imtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c84610036.imop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,6007213,32491822,69890967,43378048))
e1:SetValue(c84610036.imfilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c84610036.imfilter(e,re)
return re:GetOwner()~=e:GetOwner()
end
function c84610036.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler()
end
function c84610036.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment