Commit 4b1f3594 authored by mercury233's avatar mercury233

format

parent 31c8afe0
--おろかな重葬 --おろかな重葬
function c57995165.initial_effect(c) function c57995165.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE) e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,57995165+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,57995165+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c57995165.cost) e1:SetCost(c57995165.cost)
e1:SetTarget(c57995165.target) e1:SetTarget(c57995165.target)
e1:SetOperation(c57995165.activate) e1:SetOperation(c57995165.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not c57995165.global_check then if not c57995165.global_check then
c57995165.global_check=true c57995165.global_check=true
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SSET) ge1:SetCode(EVENT_SSET)
ge1:SetOperation(c57995165.checkop) ge1:SetOperation(c57995165.checkop)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
end end
function c57995165.checkop(e,tp,eg,ep,ev,re,r,rp) function c57995165.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(Card.IsControler,1,nil,tp) then Duel.RegisterFlagEffect(rp,57995165,RESET_PHASE+PHASE_END,0,1) end if eg:IsExists(Card.IsControler,1,nil,tp) then Duel.RegisterFlagEffect(rp,57995165,RESET_PHASE+PHASE_END,0,1) end
end end
function c57995165.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c57995165.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,57995165)==0 end if chk==0 then return Duel.GetFlagEffect(tp,57995165)==0 end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2)) Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SSET) e1:SetCode(EFFECT_CANNOT_SSET)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c57995165.tgfilter(c) function c57995165.tgfilter(c)
return c:IsAbleToGrave() return c:IsAbleToGrave()
end end
function c57995165.target(e,tp,eg,ep,ev,re,r,rp,chk) function c57995165.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c57995165.tgfilter,tp,LOCATION_EXTRA,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c57995165.tgfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
end end
function c57995165.activate(e,tp,eg,ep,ev,re,r,rp) function c57995165.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c57995165.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c57995165.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
end end
--幻姫フルドラ --幻姫フルドラ
function c81263643.initial_effect(c) function c81263643.initial_effect(c)
--to hand --to hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND) e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,81263643) e1:SetCountLimit(1,81263643)
e1:SetCost(c81263643.cost) e1:SetCost(c81263643.cost)
e1:SetTarget(c81263643.target) e1:SetTarget(c81263643.target)
e1:SetOperation(c81263643.operation) e1:SetOperation(c81263643.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c81263643.cfilter(c,tp) function c81263643.cfilter(c,tp)
if not c:IsDiscardable() then return false end if not c:IsDiscardable() then return false end
local ty=c:GetType() & (TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) local ty=c:GetType() & (TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
local log=math.log(ty)/math.log(2) local log=math.log(ty)/math.log(2)
return Duel.IsExistingMatchingCard(c81263643.filter,tp,LOCATION_GRAVE,0,1,nil,2 ^ ((log+2) % 3)) return Duel.IsExistingMatchingCard(c81263643.filter,tp,LOCATION_GRAVE,0,1,nil,2 ^ ((log+2) % 3))
end end
function c81263643.filter(c,ty) function c81263643.filter(c,ty)
return c:IsType(ty) and c:IsAbleToHand() return c:IsType(ty) and c:IsAbleToHand()
end end
function c81263643.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c81263643.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c81263643.cfilter,tp,LOCATION_HAND,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c81263643.cfilter,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c81263643.cfilter,tp,LOCATION_HAND,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,c81263643.cfilter,tp,LOCATION_HAND,0,1,1,nil,tp)
local ty=g:GetFirst():GetType() & (TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) local ty=g:GetFirst():GetType() & (TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
local log=math.log(ty)/math.log(2) local log=math.log(ty)/math.log(2)
e:SetLabel(2 ^ ((log+2) % 3)) e:SetLabel(2 ^ ((log+2) % 3))
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end end
function c81263643.target(e,tp,eg,ep,ev,re,r,rp,chk) function c81263643.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function c81263643.operation(e,tp,eg,ep,ev,re,r,rp) function c81263643.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c81263643.filter),tp,LOCATION_GRAVE,0,1,1,nil,e:GetLabel()) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c81263643.filter),tp,LOCATION_GRAVE,0,1,1,nil,e:GetLabel())
if #g>0 then if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment