--Xエクシーズ
function c2902.initial_effect(c)
--xyz level
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c2902.xyztg)
e1:SetOperation(c2902.xyzop)
c:RegisterEffect(e1)
end
function c2902.xyzfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c2902.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c2902.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c2902.xyzfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c2902.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c2902.xyzop(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 tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetValue(c2902.xyzlv)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c2902.xyzlv(e,c,rc)
return c:GetRank()
end
function c2304.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunFunRep(c,c2304.mfilter1,c2304.mfilter2,1,63,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(2304,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c2304.spcon)
e3:SetTarget(c2304.sptg)
e3:SetOperation(c2304.spop)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(c2304.indcon)
e4:SetOperation(c2304.indop)
c:RegisterEffect(e4)
end
function c2304.mfilter1(c)
return c:IsFusionSetCard(0xc7) and c:IsType(TYPE_FUSION)
end
function c2304.mfilter2(c)
return c:IsFusionSetCard(0xc7)
end
function c2304.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetReasonPlayer()~=tp and c:IsReason(REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c2304.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c2304.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(c2304.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,75347539)
and Duel.IsExistingMatchingCard(c2304.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,42901635) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c2304.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133)
or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g1=Duel.GetMatchingGroup(c2304.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp,34079868)
local g2=Duel.GetMatchingGroup(c2304.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp,98287529)
if g1:GetCount()>0 and g2:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g2:Select(tp,1,1,nil)
sg1:Merge(sg2)
Duel.SpecialSummon(sg1,0,tp,tp,true,false,POS_FACEUP)
end
end
function c2304.indcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(c:GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION and c:GetMaterialCount()>=3
end
function c2304.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(2304,0))
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
c:RegisterEffect(e2)
end
end
function c2038.zfilter(c)
return c:IsFaceup() and c:IsSetCard(0xb) and c:IsType(TYPE_SYNCHRO) and c:IsLevelAbove(8)
end
function c2038.mfilter(c)
return c:IsSetCard(0xb) and c:IsReleasableByEffect()
end
function c2038.cfilter(c,tp)
return c:GetSummonPlayer()~=tp
end
function c2038.syncon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c2038.cfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(c2038.zfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c2038.syncost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c2038.mfilter,2,nil) end
local g=Duel.SelectReleaseGroup(tp,c2038.mfilter,2,2,nil)
Duel.Release(g,REASON_COST)
end
function c2038.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and e:GetHandler():IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c2038.synop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c and Duel.CheckReleaseGroup(tp,c2038.mfilter,2,nil) then
local g=Duel.SelectReleaseGroup(tp,c2038.mfilter,2,2,nil)
if g:GetCount()>1 then
Duel.Release(g,REASON_EFFECT)
Duel.SpecialSummon(c,SUMMON_TYPE_SYNCHRO,tp,tp,true,true,POS_FACEUP)
c:CompleteProcedure()
end
end
end
c4377.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=3
and Duel.IsExistingMatchingCard(c4377.spfilter,tp,0x13,0,3,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,0x13)
end
function c4377.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<3 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c4377.spfilter),tp,0x13,0,nil,e,tp)
if g:GetCount()>2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,3,3,nil)
Duel.SpecialSummon(sg,0,tp,tp,true,true,POS_FACEUP)-> 3
end
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+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
endunction c4377.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ) and rk==4
and Duel.IsExistingMatchingCard(c4377.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1)
end
function c4377.filter2(c,e,tp,mc,rk)
if c.rum_limit_code and not mc:IsCode(c.rum_limit_code) then return false end
return c:GetRank()==rk and c:IsSetCard(0x1048) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c4377.targets(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c92365601.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c4377.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c4377.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c4377.activates(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c4377.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
endfunction c4377.filter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function c4377.targetss(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c4377.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c4377.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(4377,0))
local g=Duel.SelectTarget(tp,c48976825.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c4377.activatess(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=tg:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_RETURN)
end
end
連投失礼しました。
フィールドのモンスターを対象に取らずにX素材として吸収する効果を作ったら、
Xモンスターを吸収した時にそのモンスターのX素材だけフィールドに残ったままになてしまいました。
吸収する側から素材を前もって取り除く効果が必要みたいですが、まったくうまくいきませんでした。
GetOverlayGroupが何とかとエラーが出てしまいます。指摘をおねがいします。以下スプ
function c6511115.mtfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and (c:IsControler(tp) or c:IsAbleToChangeControler()) and not c:IsType(TYPE_TOKEN)
end
function c6511115.mttg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6511115.mtfilter,tp,0,LOCATION_MZONE,1,nil,e) end
end
function c6511115.mtop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then end
local og=Duel.SelectMatchingCard(tp,c6511115.mtfilter,tp,0,LOCATION_MZONE,1,1,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local og=tc:GetOverlayGroup()
if tc:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
Duel.Overlay(c,Group.FromCards(tc))
end
end
フィールドのモンスターを対象を取らずにX素材として吸収する効果を作ったところ、吸収したXモンスターのX素材がフィールドに残ってしまいました。
他のカード効果を参考に吸収される側の素材を取り除く効果を組み込もうとしたら、
大体エラーでGetOverlayGroupと出てきてしまいます。ご指摘をお願いします。
スプ↓
function c6511115.mtfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and (c:IsControler(tp) or c:IsAbleToChangeControler()) and not c:IsType(TYPE_TOKEN)
end
function c6511115.mttg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6511115.mtfilter,tp,0,LOCATION_MZONE,1,nil,e) end
end
function c6511115.mtop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then end
local og=Duel.SelectMatchingCard(tp,c6511115.mtfilter,tp,0,LOCATION_MZONE,1,1,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local og=tc:GetOverlayGroup()
if tc:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
Duel.Overlay(c,Group.FromCards(tc))
end
end