Skip to content

Commit 90d2a02

Browse files
authored
Added new card script
1 parent f24293b commit 90d2a02

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

pre-release/c101304051.lua

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
--神書の使いラハムゥ
2+
--Lahamu the Messenger of Sacred Scripture
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Link Summon procedure: 2 Effect Monsters
8+
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_EFFECT),2)
9+
--Once while this Link Summoned card is face-up on the field, you can Normal Summon 1 Level 5 or higher monster without Tributing
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetType(EFFECT_TYPE_FIELD)
13+
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
14+
e1:SetCode(EFFECT_SUMMON_PROC)
15+
e1:SetRange(LOCATION_MZONE)
16+
e1:SetTargetRange(LOCATION_HAND,0)
17+
e1:SetCountLimit(1,{id,0})
18+
e1:SetCondition(s.ntcon)
19+
e1:SetTarget(aux.FieldSummonProcTg(function(e,c) return c:IsLevelAbove(5) end))
20+
c:RegisterEffect(e1)
21+
--During the Main Phase, you can (Quick Effect): Immediately after this effect resolves, Normal Summon 1 Level 5 or higher DARK monster
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,1))
24+
e2:SetCategory(CATEGORY_SUMMON)
25+
e2:SetType(EFFECT_TYPE_QUICK_O)
26+
e2:SetCode(EVENT_FREE_CHAIN)
27+
e2:SetRange(LOCATION_MZONE)
28+
e2:SetCountLimit(1,{id,1})
29+
e2:SetCondition(function() return Duel.IsMainPhase() end)
30+
e2:SetTarget(s.nstg)
31+
e2:SetOperation(s.nsop)
32+
e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
33+
c:RegisterEffect(e2)
34+
--During your End Phase: You can reveal any number of monsters in your hand and place them on the bottom of the Deck in any order, then draw the same number of cards
35+
local e3=Effect.CreateEffect(c)
36+
e3:SetDescription(aux.Stringid(id,2))
37+
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
38+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
39+
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
40+
e3:SetCode(EVENT_PHASE+PHASE_END)
41+
e3:SetRange(LOCATION_MZONE)
42+
e3:SetCountLimit(1,{id,2})
43+
e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
44+
e3:SetTarget(s.drtg)
45+
e3:SetOperation(s.drop)
46+
c:RegisterEffect(e3)
47+
end
48+
function s.ntcon(e,c,minc)
49+
if c==nil then return true end
50+
return e:GetHandler():IsLinkSummoned() and minc==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
51+
end
52+
function s.nsfilter(c)
53+
return c:IsSummonable(true,nil) and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_DARK)
54+
end
55+
function s.nstg(e,tp,eg,ep,ev,re,r,rp,chk)
56+
if chk==0 then return Duel.IsExistingMatchingCard(s.nsfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) end
57+
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_MZONE)
58+
end
59+
function s.nsop(e,tp,eg,ep,ev,re,r,rp)
60+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
61+
local sc=Duel.SelectMatchingCard(tp,s.nsfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil):GetFirst()
62+
if sc then
63+
Duel.Summon(tp,sc,true,nil)
64+
end
65+
end
66+
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
67+
if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsMonster,Card.IsAbleToDeck),tp,LOCATION_HAND,0,1,nil)
68+
and Duel.IsPlayerCanDraw(tp) end
69+
Duel.SetTargetPlayer(tp)
70+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
71+
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
72+
end
73+
function s.drop(e,tp,eg,ep,ev,re,r,rp)
74+
local target_player=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
75+
local max_count=Duel.GetMatchingGroupCount(aux.AND(Card.IsMonster,Card.IsAbleToDeck),target_player,LOCATION_HAND,0,nil)
76+
if max_count==0 then return end
77+
Duel.Hint(HINT_SELECTMSG,target_player,HINTMSG_TODECK)
78+
local g=Duel.SelectMatchingCard(target_player,aux.AND(Card.IsMonster,Card.IsAbleToDeck),target_player,LOCATION_HAND,0,1,max_count,nil)
79+
if #g>0 then
80+
Duel.ConfirmCards(1-target_player,g)
81+
local draw_count=Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
82+
if draw_count>0 then
83+
if draw_count>1 then Duel.SortDeckbottom(target_player,target_player,draw_count) end
84+
Duel.BreakEffect()
85+
Duel.Draw(target_player,draw_count,REASON_EFFECT)
86+
end
87+
end
88+
end

0 commit comments

Comments
 (0)