Skip to content

Commit ea78229

Browse files
committed
added Book of Life
1 parent 0be43b8 commit ea78229

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

rush/c160402058.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
--生者の書-禁断の呪術
2+
--Book of Life
3+
--scripted by YoshiDuels
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Special Summon 1 monster from the GY
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCondition(s.condition)
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.activate)
15+
c:RegisterEffect(e1)
16+
aux.GlobalCheck(s,function()
17+
local ge1=Effect.CreateEffect(c)
18+
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
19+
ge1:SetCode(EVENT_CHAIN_SOLVED)
20+
ge1:SetOperation(s.checkop)
21+
Duel.RegisterEffect(ge1,0)
22+
end)
23+
end
24+
s.listed_names={2204140}
25+
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
26+
if re:GetHandler():IsCode(2204140) then
27+
Duel.RegisterFlagEffect(rp,id,RESET_PHASE|PHASE_END,0,1)
28+
end
29+
end
30+
function s.condition(e,tp,eg,ep,ev,re,r,rp)
31+
return Duel.GetFlagEffect(tp,id)==0 and Duel.IsExistingMatchingCard(Card.IsMonster,tp,0,LOCATION_GRAVE,1,nil)
32+
end
33+
function s.spfilter(c,e,tp)
34+
return c:IsRace(RACE_ZOMBIE) and c:IsLevelBelow(7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
35+
end
36+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
37+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
38+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
39+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
40+
end
41+
function s.tdfilter(c)
42+
return c:IsMonster() and c:IsAbleToDeck()
43+
end
44+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
45+
--Effect
46+
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
47+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
48+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
49+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
50+
if Duel.IsExistingMatchingCard(s.tdfilter,tp,0,LOCATION_GRAVE,1,nil) then
51+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
52+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tdfilter),tp,0,LOCATION_GRAVE,1,1,nil)
53+
Duel.HintSelection(g)
54+
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
55+
end
56+
end

0 commit comments

Comments
 (0)