Skip to content

Commit b395088

Browse files
authored
Added new card script
1 parent 439b908 commit b395088

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

pre-release/c100296302.lua

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
--ウィッチクラフト・シード
2+
--Witchcrafter Seed
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If this card is Normal or Special Summoned and you control a "Witchcrafter" monster other than "Witchcrafter Seed", or "Regulus, the Prince of Endymion": You can target 1 face-up card on the field; return it to the hand
7+
local e1a=Effect.CreateEffect(c)
8+
e1a:SetDescription(aux.Stringid(id,0))
9+
e1a:SetCategory(CATEGORY_TOHAND)
10+
e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
12+
e1a:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1a:SetCountLimit(1,{id,0})
14+
e1a:SetTarget(s.rthtg)
15+
e1a:SetOperation(s.rthop)
16+
c:RegisterEffect(e1a)
17+
local e1b=e1a:Clone()
18+
e1b:SetCode(EVENT_SPSUMMON_SUCCESS)
19+
c:RegisterEffect(e1b)
20+
--You can banish this card from your GY; reveal any number of cards in your hand, including a Spell, and shuffle them into the Deck, then draw that many cards
21+
local e2=Effect.CreateEffect(c)
22+
e2:SetDescription(aux.Stringid(id,1))
23+
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
24+
e2:SetType(EFFECT_TYPE_IGNITION)
25+
e2:SetRange(LOCATION_GRAVE)
26+
e2:SetCountLimit(1,{id,1})
27+
e2:SetCost(Cost.SelfBanish)
28+
e2:SetTarget(s.drtg)
29+
e2:SetOperation(s.drop)
30+
c:RegisterEffect(e2)
31+
end
32+
s.listed_series={SET_WITCHCRAFTER}
33+
s.listed_names={id,CARD_REGULUS_THE_PRINCE_OF_ENDYMION}
34+
function s.rthconfilter(c)
35+
return ((c:IsSetCard(SET_WITCHCRAFTER) and c:IsMonster() and not c:IsCode(id)) or c:IsCode(CARD_REGULUS_THE_PRINCE_OF_ENDYMION))
36+
and c:IsFaceup()
37+
end
38+
function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
39+
if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc:IsAbleToHand() end
40+
if chk==0 then return Duel.IsExistingMatchingCard(s.rthconfilter,tp,LOCATION_ONFIELD,0,1,nil)
41+
and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAbleToHand),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
42+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
43+
local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsAbleToHand),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
44+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0)
45+
end
46+
function s.rthop(e,tp,eg,ep,ev,re,r,rp)
47+
local tc=Duel.GetFirstTarget()
48+
if tc:IsRelateToEffect(e) then
49+
Duel.SendtoHand(tc,nil,REASON_EFFECT)
50+
end
51+
end
52+
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
53+
if chk==0 then return Duel.IsPlayerCanDraw(tp)
54+
and Duel.IsExistingMatchingCard(aux.AND(Card.IsSpell,Card.IsAbleToDeck,aux.NOT(Card.IsPublic)),tp,LOCATION_HAND,0,1,nil) end
55+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
56+
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
57+
end
58+
function s.rescon(sg,e,tp,mg)
59+
return sg:IsExists(Card.IsSpell,1,nil)
60+
end
61+
function s.drop(e,tp,eg,ep,ev,re,r,rp)
62+
local g=Duel.GetMatchingGroup(aux.AND(Card.IsAbleToDeck,aux.NOT(Card.IsPublic)),tp,LOCATION_HAND,0,nil)
63+
if #g==0 then return end
64+
local sg=aux.SelectUnselectGroup(g,e,tp,1,#g,s.rescon,1,tp,HINTMSG_TODECK,s.rescon)
65+
if #sg>0 then
66+
Duel.ConfirmCards(1-tp,sg)
67+
local returned_count=Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
68+
if returned_count>0 then
69+
Duel.ShuffleDeck(tp)
70+
if Duel.IsPlayerCanDraw(tp) then
71+
Duel.BreakEffect()
72+
Duel.Draw(tp,returned_count,REASON_EFFECT)
73+
end
74+
end
75+
end
76+
end

0 commit comments

Comments
 (0)