Skip to content

Commit db4b730

Browse files
authored
Added new card scripts
1 parent 5638539 commit db4b730

2 files changed

Lines changed: 190 additions & 0 deletions

File tree

pre-release/c100455024.lua

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
--ウィッチクラフト・マルカ
2+
--Witchcrafter Marka
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--You can Tribute this card from your hand or field; add 1 "Witchcrafter" Field or Continuous Spell from your Deck to your hand
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetRange(LOCATION_HAND|LOCATION_MZONE)
12+
e1:SetCountLimit(1,{id,0})
13+
e1:SetCost(Cost.SelfTribute)
14+
e1:SetTarget(s.thtg)
15+
e1:SetOperation(s.thop)
16+
c:RegisterEffect(e1)
17+
--If a face-up "Witchcrafter" monster(s) you control leaves the field by an opponent's card effect, while this card is in your GY: You can Special Summon this card (but banish it when it leaves the field), and if you do, Tribute 1 monster your opponent controls
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE+CATEGORY_RELEASE)
21+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
22+
e2:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS)
23+
e2:SetCode(EVENT_LEAVE_FIELD)
24+
e2:SetRange(LOCATION_GRAVE)
25+
e2:SetCountLimit(1,{id,1})
26+
e2:SetCondition(s.spcon)
27+
e2:SetTarget(s.sptg)
28+
e2:SetOperation(s.spop)
29+
c:RegisterEffect(e2)
30+
end
31+
s.listed_series={SET_WITCHCRAFTER}
32+
function s.thfilter(c)
33+
return c:IsSetCard(SET_WITCHCRAFTER) and (c:IsFieldSpell() or c:IsContinuousSpell()) and c:IsAbleToHand()
34+
end
35+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
36+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
37+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
38+
end
39+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
40+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
41+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
42+
if #g>0 then
43+
Duel.SendtoHand(g,nil,REASON_EFFECT)
44+
Duel.ConfirmCards(1-tp,g)
45+
end
46+
end
47+
function s.spconfilter(c,tp,opp)
48+
return c:IsPreviousSetCard(SET_WITCHCRAFTER) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
49+
and c:IsPreviousControler(tp) and c:IsReasonPlayer(opp) and c:IsReason(REASON_EFFECT)
50+
end
51+
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
52+
return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.spconfilter,1,nil,tp,1-tp)
53+
end
54+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
55+
local c=e:GetHandler()
56+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
57+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
58+
and Duel.IsExistingMatchingCard(Card.IsReleasableByEffect,tp,0,LOCATION_MZONE,1,nil) end
59+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
60+
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,1-tp,LOCATION_MZONE)
61+
end
62+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
63+
local c=e:GetHandler()
64+
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
65+
--Banish it when it leaves the field
66+
local e1=Effect.CreateEffect(c)
67+
e1:SetDescription(3300)
68+
e1:SetType(EFFECT_TYPE_SINGLE)
69+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
70+
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
71+
e1:SetValue(LOCATION_REMOVED)
72+
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
73+
c:RegisterEffect(e1)
74+
end
75+
if Duel.SpecialSummonComplete()==0 then return end
76+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
77+
local g=Duel.SelectMatchingCard(tp,Card.IsReleasableByEffect,tp,0,LOCATION_MZONE,1,1,nil)
78+
if #g>0 then
79+
Duel.HintSelection(g)
80+
Duel.Release(g,REASON_EFFECT)
81+
end
82+
end

pre-release/c100455026.lua

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
--ウィッチクラフト・ピューピルズ
2+
--Witchcrafter Pupils
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 1 "Witchcrafter" monster + 1 Spellcaster monster
8+
Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_WITCHCRAFTER),aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER))
9+
--During the Main or Battle Phase (Quick Effect): You can activate 1 of these effects;
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetType(EFFECT_TYPE_QUICK_O)
13+
e1:SetCode(EVENT_FREE_CHAIN)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetCountLimit(1,{id,0})
16+
e1:SetCondition(function() return Duel.IsMainPhase() or Duel.IsBattlePhase() end)
17+
e1:SetCost(Cost.Choice(
18+
--● Add 1 "Witchcrafter" Spell from your Deck to your hand
19+
{aux.TRUE,aux.Stringid(id,2),function(e,tp) return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end},
20+
--● Reveal 1 "Witchcrafter" Normal or Quick-Play Spell in your hand; apply that Spell's activation effect
21+
{Cost.Reveal(s.revealfilter,nil,1,1,function(e,tp,og) e:SetLabelObject(og) end),aux.Stringid(id,3),nil}
22+
)
23+
)
24+
e1:SetTarget(s.efftg)
25+
e1:SetOperation(s.effop)
26+
e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_START|TIMING_BATTLE_END|TIMINGS_CHECK_MONSTER)
27+
c:RegisterEffect(e1)
28+
--During your End Phase: You can return 1 of your banished "Witchcrafter" cards to the GY
29+
local e2=Effect.CreateEffect(c)
30+
e2:SetDescription(aux.Stringid(id,1))
31+
e2:SetCategory(CATEGORY_TOGRAVE)
32+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
33+
e2:SetCode(EVENT_PHASE+PHASE_END)
34+
e2:SetRange(LOCATION_MZONE)
35+
e2:SetCountLimit(1,{id,1})
36+
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
37+
e2:SetTarget(s.rtgtg)
38+
e2:SetOperation(s.rtgop)
39+
c:RegisterEffect(e2)
40+
end
41+
s.listed_series={SET_WITCHCRAFTER}
42+
s.material_setcode=SET_WITCHCRAFTER
43+
function s.thfilter(c)
44+
return c:IsSetCard(SET_WITCHCRAFTER) and c:IsSpell() and c:IsAbleToHand()
45+
end
46+
function s.revealfilter(c)
47+
return c:IsSetCard(SET_WITCHCRAFTER) and (c:IsNormalSpell() or c:IsQuickPlaySpell())
48+
and c:CheckActivateEffect(true,true,false)~=nil
49+
and c:CheckActivateEffect(true,true,false):GetOperation()~=nil
50+
end
51+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
52+
if chk==0 then return true end
53+
local op=e:GetLabel()
54+
if op==1 then
55+
--● Add 1 "Witchcrafter" Spell from your Deck to your hand
56+
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
57+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
58+
elseif op==2 then
59+
--● Reveal 1 "Witchcrafter" Normal or Quick-Play Spell in your hand; apply that Spell's activation effect
60+
e:SetCategory(0)
61+
local revealed_card=e:GetLabelObject():GetFirst()
62+
local te,ceg,cep,cev,cre,cr,crp=revealed_card:CheckActivateEffect(true,true,true)
63+
Duel.ClearTargetCard()
64+
local tg=te:GetTarget()
65+
e:SetProperty(te:GetProperty())
66+
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
67+
te:SetLabelObject(e:GetLabelObject())
68+
e:SetLabelObject(te)
69+
e:SetCategory(0)
70+
Duel.ClearOperationInfo(0)
71+
end
72+
end
73+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
74+
local op=e:GetLabel()
75+
if op==1 then
76+
--● Add 1 "Witchcrafter" Spell from your Deck to your hand
77+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
78+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
79+
if #g>0 then
80+
Duel.SendtoHand(g,nil,REASON_EFFECT)
81+
Duel.ConfirmCards(1-tp,g)
82+
end
83+
elseif op==2 then
84+
--● Reveal 1 "Witchcrafter" Normal or Quick-Play Spell in your hand; apply that Spell's activation effect
85+
local te=e:GetLabelObject()
86+
if not te then return end
87+
e:SetLabelObject(te:GetLabelObject())
88+
local op=te:GetOperation()
89+
if op then
90+
op(e,tp,eg,ep,ev,re,r,rp)
91+
end
92+
end
93+
end
94+
function s.rtgfilter(c)
95+
return c:IsSetCard(SET_WITCHCRAFTER) and c:IsFaceup() and c:IsAbleToGrave()
96+
end
97+
function s.rtgtg(e,tp,eg,ep,ev,re,r,rp,chk)
98+
if chk==0 then return Duel.IsExistingMatchingCard(s.rtgfilter,tp,LOCATION_REMOVED,0,1,nil) end
99+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_REMOVED)
100+
end
101+
function s.rtgop(e,tp,eg,ep,ev,re,r,rp)
102+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOGRAVE)
103+
local g=Duel.SelectMatchingCard(tp,s.rtgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
104+
if #g>0 then
105+
Duel.HintSelection(g)
106+
Duel.SendtoGrave(g,REASON_EFFECT)
107+
end
108+
end

0 commit comments

Comments
 (0)