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
リバイバルゴーレムの
e:SetLabel(opt)
if opt==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
elseif opt==2 then
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
else
e:SetCategory(0)
end
の部分にはどういう意味があるんですか?
ちなみにe:GetHandler()は自分自身、つまり発動しているこのカード(リバイバルゴーレム)のこと
これの代わりにtcとか適当な文字を置いて、その前の時点で
local tc=Duel.IsExistingMatchingCard(ここはさっきみたいに決められた数値を入れる)
とかでtcがどういうカードかを定義しておけばいい
>>263
そのデッキ用の効果ってのがちょっと上手くいかないんです
すごく短いので載せます
function c2000000005.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c2000000005.cost)
e1:SetOperation(c2000000005.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e1:SetRange(0xf7)
c:RegisterEffect(e2)
end
function c2000000005.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
function c2000000005.op(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Draw(tp,2,REASON_EFFECT)
end
これで全部です
手札からもデッキからも発動はできますが、デッキからの発動がシャドーループと全然違うのですっきりしないのです
--special summon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(122446869,0))
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetTarget(c122446869.target)
e6:SetOperation(c122446869.operation)
c:RegisterEffect(e6)
function c122446869.grfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand and LOCATION_GRAVE
end
function c122446869.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local opt=0
local c=e:GetHandler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=c:IsAbleToHand()
if b1 and b2 then
opt=Duel.SelectOption(tp,aux.Stringid(122446869,1),aux.Stringid(122446869,2))+1
elseif b1 then
opt=Duel.SelectOption(tp,aux.Stringid(122446869,1))+1
elseif b2 then
opt=Duel.SelectOption(tp,aux.Stringid(122446869,2))+2
end
e:SetLabel(opt)
if opt==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c122446869.grfilter(),1,0,0)
elseif opt==2 then
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c122446869.grfilter(),1,0,0)
else
e:SetCategory(0)
end
end
function c122446869.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c122446869.grfilter,0,tp,tp,false,false,POS_FACEUP)
end
elseif e:GetLabel()==2 then
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c122446869.grfilter,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
end
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand and LOCATION_GRAVE
end
のどこかまでわかってたら、その中身をちょっとずつ削る
エラーログはなぜかデュエル中は全部表示されない(上に同じ奴がいっぱい出る)から、サレンダーしてソリティアの画面に戻ると上の部分が見える
魔力の枷から効果発動にコストを課す所だけ抜き出してみました
function c2000000005.initial_effect(c)
--Activate
〜〜e1は発動なので省略〜〜
--activate cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(c2000000005.actarget)
e2:SetOperation(c2000000005.costop)
c:RegisterEffect(e2)
end
function c2000000005.actarget(e,te,tp)
return te:GetHandler():IsLocation(LOCATION_HAND)
end
function c2000000005.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500)
end
どうやらプレイヤーを対象にしているようですが……どこをどう攻めたらいいか全くわかりません
類似効果のカードがあれば参考にもできましょうが
>>280
うーむこういうことでしょうか
local e2=Effect.CreateEffect(c)
〜〜略〜〜
e2:SetRange(LOCATION_DECK)
e2:SetLabelObject(e3)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetOperation(c2000000005.op)
c:RegisterEffect(e3)
end
function c2000000005.actarget(e,te,tp)
return te==e:GetLabelObject()
end
function c2000000005.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500)
end
function c2000000005.op(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Draw(tp,2,REASON_EFFECT)
end
local e2=e1:Clone()
e2:SetRange(LOCATION_DECK)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_DECK)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetTarget(c2000000005.actarget)
e3:SetOperation(c2000000005.costop)
c:RegisterEffect(e3)
e3:SetLabelObject(e2)
〜〜
function c2000000005.actarget(e,te,tp)
return te==e:GetLabelObject()
end
function c2000000005.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
.filterとかは自分で宣言して作ってる関数だから引数は何でも入れられる
例えば
function cX.filter(c,tc)
return c:GetAttack()==tc:GetAttack()
end
〜〜
cX.filter(sc,e:GetHandler())
とか
function cX.filter(c,e)
return c:GetAttack()==e:GetHandler():GetAttack()
end
〜〜
cX.filter(sc,e)
とか
質問の答えはこれで良いのかな…?