--灯火之缄默 local m=28327023 local cm=_G["c"..m] function cm.initial_effect(c) aux.AddCodeList(c,28327000) aux.AddRitualProcGreaterCode(c,28327000) --to hand local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_DRAW) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_FREE_CHAIN) e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e5:SetRange(LOCATION_GRAVE) e5:SetCountLimit(1,m) e5:SetCondition(cm.thcon) e5:SetCost(cm.thcost) e5:SetTarget(cm.thtg) e5:SetOperation(cm.thop) c:RegisterEffect(e5) --act in hand local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_TRAP_ACT_IN_HAND) e2:SetCondition(cm.handcon) c:RegisterEffect(e2) end function cm.cfilter(c) return c:IsFaceup() and c:IsCode(28327000) end function cm.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) end function cm.costfilter(c) return c:IsCode(28327000) and c:IsDiscardable() end function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,1) Duel.DiscardHand(tp,cm.costfilter,1,1,REASON_COST+REASON_DISCARD,nil) end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(cm.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function cm.splimit(e,c) return c:IsLocation(LOCATION_EXTRA) end function cm.handcon(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0 end