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
end
function c2170.etarget(e,c)
return c:IsSetCard(0x999) and not IsCode(2170)
end
function c2170.efilter(e,re)
return re:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
対象取らない吸収の時の者です。
相手の耐性を無視してX素材化する事態が発生することがわかったため
いろいろ錯誤しましたが結局ここに来ちゃいました。
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local og=Duel.SelectMatchingCard(tp,c5.mtfilter,tp,0,LOCATION_MZONE,1,1,nil,e)
if c:IsRelateToEffect(e) and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) then
if chk==0 then return og:GetFirst():RemoveOverlayCard(tp,1,REASON_RULE) end
local g=og:GetFirst():GetOverlayGroup()
if og:GetCount()>0 then end
Duel.SendtoGrave(g,REASON_RULE)
end
Duel.Overlay(c,og)
恐らくIsImmuneToEffect(e)で制御するものと思いましたが、うまくいきませんでした
ご指摘をお願いします。
↓真竜皇アグニマズドVの①の効果のスクリプトなのですが、各部分の意味を教えてください
function c96746083.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_MZONE+LOCATION_HAND
if ft<0 then loc=LOCATION_MZONE end
local loc2=0
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c96746083.desfilter,tp,loc,loc2,c)
if g:GetCount()<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE) then return end
local g1=nil local g2=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if ft<1 then
g1=g:FilterSelect(tp,c96746083.locfilter,1,1,nil,tp)
else
g1=g:Select(tp,1,1,nil)
end
g:RemoveCard(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if g1:GetFirst():IsAttribute(ATTRIBUTE_FIRE) then
g2=g:Select(tp,1,1,nil)
else
g2=g:FilterSelect(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_FIRE)
end
g1:Merge(g2)
local rm=g1:IsExists(Card.IsAttribute,2,nil,ATTRIBUTE_FIRE)
if Duel.Destroy(g1,REASON_EFFECT)==2 then
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE)
return
end
local rg=Duel.GetMatchingGroup(c96746083.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,tp)
if rm and rg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(96746083,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=rg:Select(tp,1,1,nil)
Duel.HintSelection(tg)
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
end
end
ディニクアビスの特殊召喚効果をフリーチェーン化したのですが、自身の効果にチェーンして重複して発動できてしまいます。
どうスクリプトを修正すればいいでしょうか?
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(122446869,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c122446869.spcost)
e1:SetTarget(c122446869.sptg)
e1:SetOperation(c122446869.spop)
c:RegisterEffect(e1)
function c122446869.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c122446869.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c122446869.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c122446869.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 c122446869.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE)
end
end