ちなみに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)
とか
質問の答えはこれで良いのかな…?
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
ここのcの定義を水属性モンスターに変更するにはどうすればいいでしょうか?
定義のやり方だけでもいいので教えてください…
結局ダイナスターからひっぱてやってみたんですが
素材揃っていても出せず「e2:SetCondition(c300.spcon)」を消したら素材の有無に関係なく出せてしまい素材もリリースされません
function c300.initial_effect(c)
--fusion material
c:EnableReviveLimit()
--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(c300.splimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c300.spcon)
e2:SetOperation(c300.spop)
c:RegisterEffect(e2)
end
function c300.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c300.spfilter1(c,tp,fc)
return c:IsFusionSetCard(0xe2) and c:IsType(TYPE_FIELD) and c:IsCanBeFusionMaterial(fc)
and Duel.CheckReleaseGroup(tp,c300.spfilter2,1,c,fc)
end
function c300.spfilter2(c,fc)
return c:IsType(TYPE_FIELD) and c:IsSetCard(0xe2) and c:IsCanBeFusionMaterial(fc)
end
function c300.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_ONFIELD+LOCATION_HAND)>-2
and Duel.CheckReleaseGroup(tp,c300.spfilter1,1,nil,tp,c)
end
function c300.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=Duel.SelectReleaseGroup(tp,c300.spfilter1,1,1,nil,tp,c)
local g2=Duel.SelectReleaseGroup(tp,c300.spfilter2,1,1,g1:GetFirst(),c)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Release(g1,REASON_COST+REASON_FUSION+REASON_MATERIAL)
end
function c300.spfilter(c,e,tp)
return c:IsSetCard(0xe2) and c:IsType(TYPE_FIELD) and c:IsSetCard(0xe2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
自分はこんな感じに落ち着きましたがいかがでしょうか?
function c2129638.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunFunRep(c,c2129638.mfilter1,c2129638.mfilter2,1,true,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(c2129638.splimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c2129638.spcon)
e2:SetOperation(c2129638.spop)
c:RegisterEffect(e2)
end
function c2129638.mfilter1(c)
return c:IsSetCard(0xe2) and c:IsType(TYPE_FIELD)
end
function c2129638.mfilter2(c)
return c:IsSetCard(0xe2) and c:IsType(TYPE_MONSTER)
end
function c2129638.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c2129638.spfilter1(c,fc)
return c:IsSetCard(0xe2) and c:IsType(TYPE_FIELD) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGraveAsCost()
end
function c2129638.spfilter2(c,fc)
return c:IsSetCard(0xe2) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGraveAsCost()
end
function c2129638.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_ONFIELD+LOCATION_HAND)>-2
and Duel.IsExistingMatchingCard(c2129638.spfilter1,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil,c)
and Duel.IsExistingMatchingCard(c2129638.spfilter2,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil,c)
end
function c2129638.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c2129638.spfilter1,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil,c)
local g2=Duel.SelectMatchingCard(tp,c2129638.spfilter2,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil,c)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_COST)
end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
これのcってどうやって「同名カードを除く水属性モンスター」を定義するように書き換えるんですか?
元は
local c=e:GetHandler()
です。
選択肢を出す奴を作ってみてるのですが以下のエラーが出ます
22:Parameter 2 should be "Effect".
該当行は
function c1500.filter2(c,e,tp)
return c:IsType(TYPE_MONSTER)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
の特殊召喚の下りです
そこを消したらエラーは出ないのですがいろいろと困ります
アドバイスよろしくお願いします
function c3006.filter(c)
return c:IsCode(78785392) and c:IsAbleToHand()
end
function c3006.target (e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c3006.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c3006.target (e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c3006.filter,tp,LOCATION_DECK,0,1,nil) end
local sg=Duel.GetMatchingGroup(c3006.filter,tp,LOCATION_DECK,0,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,sg:GetCount(),0,0)
end
function c3006.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c3006.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(c3006.filter,tp,LOCATION_DECK,0,nil)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
end
function c2261.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x798)
and Duel.IsExistingTarget(aux.TRUE,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c2261.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c2261.desfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c2261.desfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1:GetFirst())
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,g1:GetCount(),0,0)
end
function c2261.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT)
end