local m=77709008 local cm=_G["c"..m] xpcall(function() require("expansions/script/lap") end,function() require("expansions/sekka1217/script/lap") end) Duel.LoadScript("c37564765.lua") cm.Sekka_name_with_lap=true function cm.initial_effect(c) c:EnableReviveLimit() Sekka.LapGlobalCheck() local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,m) e1:SetDescription(aux.Stringid(m,0)) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) local turn=Duel.GetTurnCount() return Sekka.lap_check_list[turn] and Sekka.lap_check_list[turn][tp]>=1 end) e1:SetTarget(cm.target1) e1:SetOperation(cm.activate1) c:RegisterEffect(e1) local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(0x14000) e1:SetCountLimit(1,m+100) e1:SetDescription(aux.Stringid(m,1)) e1:SetCondition(Senya.SummonTypeCondition(SUMMON_TYPE_RITUAL)) e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_HAND,1,nil) end local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_HAND,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end) e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND) if #g==0 then return end Duel.ConfirmCards(tp,g) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,1,1,nil) Duel.SendtoHand(sg,tp,REASON_EFFECT) end) c:RegisterEffect(e1) local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,m+200) e3:SetCost(cm.thcost) e3:SetTarget(cm.thtg) e3:SetOperation(cm.thop) c:RegisterEffect(e3) end function cm.hfilter(c) return c:IsCode(m-8) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY) end function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.hfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function cm.activate1(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cm.hfilter,tp,LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) local function f(c) return c:IsDiscardable() end if chk==0 then return Duel.IsExistingMatchingCard(f,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.DiscardHand(tp,f,1,1,REASON_COST+REASON_DISCARD) end function cm.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 cm.thop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) end end