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
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(130000001,0))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e5:SetHintTiming(0,0x1c0)
e5:SetRange(LOCATION_EXTRA)
e5:SetCondition(c130000001.sprdon)
e5:SetOperation(c130000001.sprdop)
c:RegisterEffect(e5)
function c130000001.sprdon(e,tp,eg,ep,ev,re,r,rp)
if c==nil then return true end
local tp=c:GetControler()
local selfExist = not Duel.IsExistingMatchingCard(c130000001.sprdfilter,tp,LOCATION_ONFIELD,0,1,nil)
--醒めない悪夢からの移植記述1
local selfNotChain = e:GetHandler():GetFlagEffect(130000001)==0
return selfExist and selfNotChain
--醒めない悪夢からの移植記述2(この行でエラー発生)
e:GetHandler():RegisterFlagEffect(130000001,RESET_CHAIN,0,1)
end
function c130000001.sprdfilter(c)
return c:IsCode(130000001) and c:IsFaceup()
end
function c130000001.sprdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if Duel.SpecialSummon(e:GetHandler(),SUMMON_TYPE_FUSION,tp,tp,true,false,POS_FACEUP_ATTACK)~=0 then
e:GetHandler():CompleteProcedure()
end
end
end
function c1000.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_REMOVED)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_REMOVE)
e1:SetCondition(c9000.thcon)
e1:SetTarget(c9000.thtg)
e1:SetOperation(c9000.thop)
c:RegisterEffect(e1)
end
function c1000.thfilter(c,e,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c1000.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c1000.thfilter,1,nil,e,tp)
end
function c1000.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c1000.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
return x~=0
は「xが真であるならば真を返し、偽であるならば偽を返す」という意味で用いられている可能性が(そのコードを書いた人が常識知らずでなければ)非常に高い。
また、
if x==0 then return false end
は「xが偽であるならば偽を返す。真である場合は以降のコードに進む」という意味合いであろう。
>>384
どっちも書いてる事は同じ(マットの書き方は冗長)
「Aの効果を発動した」かどうかは大体の場合は
① AのCost内でRegisterFlagEffectで自身にフラグを立てる
② GetFlagEffectでAを発動したか判断
という手順
永続罠の効果の発動なんかでも良く見られる書き方だね