Skip to content

Commit c83a286

Browse files
authored
Added new card scripts
1 parent e29c311 commit c83a286

File tree

9 files changed

+1012
-0
lines changed

9 files changed

+1012
-0
lines changed

pre-release/c101302101.lua

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--DDランス・ソルジャー
2+
--D/D Lance Soldier
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Increase the Level of 1 "D/D" monster you control by up to the number of "Dark Contract" cards in your field and GY
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_LVCHANGE)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
12+
e1:SetRange(LOCATION_MZONE)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.lvtg)
15+
e1:SetOperation(s.lvop)
16+
c:RegisterEffect(e1)
17+
--Destroy 1 "Dark Contract" card you control, and if you do, Special Summon this card
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
23+
e2:SetRange(LOCATION_GRAVE)
24+
e2:SetCountLimit(1,{id,1})
25+
e2:SetTarget(s.destg)
26+
e2:SetOperation(s.desop)
27+
c:RegisterEffect(e2)
28+
end
29+
s.listed_series={SET_DD,SET_DARK_CONTRACT}
30+
function s.lvfilter(c)
31+
return c:IsSetCard(SET_DD) and c:HasLevel() and c:IsFaceup()
32+
end
33+
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
34+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc) end
35+
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil)
36+
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_DARK_CONTRACT),tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,1,nil) end
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
38+
Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil)
39+
end
40+
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
41+
local tc=Duel.GetFirstTarget()
42+
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or not tc:HasLevel() then return end
43+
local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_DARK_CONTRACT),tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,nil)
44+
if ct==0 then return end
45+
local lv=Duel.AnnounceLevel(tp,1,ct)
46+
if lv then
47+
tc:UpdateLevel(lv,nil,e:GetHandler())
48+
end
49+
end
50+
function s.desfilter(c,tp)
51+
return c:IsSetCard(SET_DARK_CONTRACT) and c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0
52+
end
53+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
54+
local c=e:GetHandler()
55+
if chkc then return chkc:IsControler(tp) and chkc:IsOnField() and s.desfilter(chkc,tp) end
56+
if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
57+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
58+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
59+
local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
60+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
61+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
62+
end
63+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
64+
local c=e:GetHandler()
65+
local tc=Duel.GetFirstTarget()
66+
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and c:IsRelateToEffect(e)
67+
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
68+
--Banish it when it leaves the field
69+
local e1=Effect.CreateEffect(c)
70+
e1:SetDescription(3300)
71+
e1:SetType(EFFECT_TYPE_SINGLE)
72+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
73+
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
74+
e1:SetValue(LOCATION_REMOVED)
75+
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
76+
c:RegisterEffect(e1,true)
77+
end
78+
end

pre-release/c101302102.lua

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
--DDディフェンス・ソルジャー
2+
--D/D Defense Soldier
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Activate 1 of these effects
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_IGNITION)
10+
e1:SetRange(LOCATION_MZONE)
11+
e1:SetCountLimit(1,id)
12+
e1:SetTarget(s.efftg)
13+
e1:SetOperation(s.effop)
14+
c:RegisterEffect(e1)
15+
--Add 1 "D/D" Pendulum Monster from your face-up Extra Deck or GY to your hand
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,1))
18+
e2:SetCategory(CATEGORY_TOHAND)
19+
e2:SetType(EFFECT_TYPE_IGNITION)
20+
e2:SetRange(LOCATION_GRAVE)
21+
e2:SetCountLimit(1,{id,1})
22+
e2:SetCost(Cost.SelfBanish)
23+
e2:SetTarget(s.thtg)
24+
e2:SetOperation(s.thop)
25+
c:RegisterEffect(e2)
26+
end
27+
s.listed_series={SET_DD,SET_DDD}
28+
function s.spfilter(c,e,tp)
29+
return c:IsSetCard(SET_DD) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
30+
end
31+
function s.limcostfilter(c)
32+
return c:IsSetCard(SET_DD) and c:IsMonster() and c:IsAbleToRemoveAsCost()
33+
end
34+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
35+
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
36+
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
37+
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_PZONE,0,1,nil,e,tp)
38+
local b2=not Duel.HasFlagEffect(tp,id)
39+
and Duel.IsExistingMatchingCard(s.limcostfilter,tp,LOCATION_GRAVE,0,1,nil)
40+
if chk==0 then return b1 or b2 end
41+
local op=Duel.SelectEffect(tp,
42+
{b1,aux.Stringid(id,2)},
43+
{b2,aux.Stringid(id,3)})
44+
e:SetLabel(op)
45+
if op==1 then
46+
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
47+
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
48+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
49+
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_PZONE,0,1,1,nil,e,tp)
50+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
51+
elseif op==2 then
52+
e:SetCategory(0)
53+
e:SetProperty(0)
54+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
55+
local g=Duel.SelectMatchingCard(tp,s.limcostfilter,tp,LOCATION_GRAVE,0,1,1,nil)
56+
Duel.Remove(g,POS_FACEUP,REASON_COST)
57+
end
58+
end
59+
function s.effop(e,tp,eg,ep,ev,re,r,rp,chk)
60+
local op=e:GetLabel()
61+
if op==1 then
62+
--Special Summon 1 "D/D" card in your Pendulum Zone
63+
local tc=Duel.GetFirstTarget()
64+
if tc:IsRelateToEffect(e) then
65+
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
66+
end
67+
elseif op==2 then
68+
if Duel.HasFlagEffect(tp,id) then return end
69+
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
70+
--If your "D/D/D" monster attacks this turn, your opponent cannot activate cards or effects until the end of the Damage Step
71+
local e1=Effect.CreateEffect(e:GetHandler())
72+
e1:SetDescription(aux.Stringid(id,4))
73+
e1:SetType(EFFECT_TYPE_FIELD)
74+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
75+
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
76+
e1:SetRange(LOCATION_MZONE)
77+
e1:SetTargetRange(0,1)
78+
e1:SetCondition(s.actcon)
79+
e1:SetValue(1)
80+
e1:SetReset(RESET_PHASE|PHASE_END)
81+
Duel.RegisterEffect(e1,tp)
82+
end
83+
end
84+
function s.actcon(e)
85+
local tc=Duel.GetAttacker()
86+
return tc and tc:IsSetCard(SET_DDD) and tc:IsControler(e:GetHandlerPlayer())
87+
end
88+
function s.thfilter(c)
89+
return c:IsSetCard(SET_DD) and c:IsType(TYPE_PENDULUM) and c:IsFaceup() and c:IsAbleToHand()
90+
end
91+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
92+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_EXTRA|LOCATION_GRAVE,0,1,e:GetHandler()) end
93+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA|LOCATION_GRAVE)
94+
end
95+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
96+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
97+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_EXTRA|LOCATION_GRAVE,0,1,1,nil)
98+
if #g>0 then
99+
Duel.SendtoHand(g,nil,REASON_EFFECT)
100+
Duel.ConfirmCards(1-tp,g)
101+
end
102+
end

pre-release/c101302103.lua

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
--DDD零死王ゼロ・マキナ
2+
--D/D/D Zero Demise King Zero Machinex
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Pendulum Summon procedure
7+
Pendulum.AddProcedure(c,false)
8+
--Check if it was activated this turn
9+
local e0=Effect.CreateEffect(c)
10+
e0:SetDescription(1160)
11+
e0:SetType(EFFECT_TYPE_ACTIVATE)
12+
e0:SetCode(EVENT_FREE_CHAIN)
13+
e0:SetRange(LOCATION_HAND)
14+
e0:SetCost(s.actreg)
15+
c:RegisterEffect(e0)
16+
--Place 1 "Dark Contract" Continuous Spell/Trap on the field
17+
local e1=Effect.CreateEffect(c)
18+
e1:SetDescription(aux.Stringid(id,0))
19+
e1:SetType(EFFECT_TYPE_IGNITION)
20+
e1:SetRange(LOCATION_PZONE)
21+
e1:SetCountLimit(1,id)
22+
e1:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end)
23+
e1:SetTarget(s.pltg)
24+
e1:SetOperation(s.plop)
25+
c:RegisterEffect(e1)
26+
--Special Summon this card from the Extra Deck if a "Dark Contract" or "D/D/D" card(s) is destroyed
27+
local e2=Effect.CreateEffect(c)
28+
e2:SetDescription(aux.Stringid(id,1))
29+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
30+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
31+
e2:SetCode(EVENT_DESTROYED)
32+
e2:SetRange(LOCATION_EXTRA)
33+
e2:SetCountLimit(1,{id,1})
34+
e2:SetCondition(s.spcon)
35+
e2:SetTarget(s.sptg)
36+
e2:SetOperation(s.spop)
37+
c:RegisterEffect(e2)
38+
--Place this card in the Pendulum Zone if it's destroyed
39+
local e3=Effect.CreateEffect(c)
40+
e3:SetDescription(aux.Stringid(id,2))
41+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
42+
e3:SetProperty(EFFECT_FLAG_DELAY)
43+
e3:SetCode(EVENT_DESTROYED)
44+
e3:SetCountLimit(1,{id,2})
45+
e3:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_MZONE) end)
46+
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckPendulumZones(tp) end end)
47+
e3:SetOperation(s.penop)
48+
c:RegisterEffect(e3)
49+
end
50+
s.listed_series={SET_DARK_CONTRACT,SET_DDD}
51+
s.listed_names={id}
52+
function s.actreg(e,tp,eg,ep,ev,re,r,rp,chk)
53+
if chk==0 then return true end
54+
e:GetHandler():RegisterFlagEffect(id,RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1)
55+
end
56+
function s.plfilter(c,tp)
57+
return c:IsSetCard(SET_DARK_CONTRACT) and c:IsContinuousSpellTrap() and not c:IsForbidden() and c:CheckUniqueOnField(tp)
58+
end
59+
function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
60+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
61+
and Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_DECK,0,1,nil,tp) end
62+
end
63+
function s.plop(e,tp,eg,ep,ev,re,r,rp)
64+
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
65+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
66+
local sc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
67+
if sc then
68+
Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
69+
end
70+
end
71+
function s.spconfilter(c,tp)
72+
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and not c:IsPreviousCodeOnField(id)
73+
and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard({SET_DDD,SET_DARK_CONTRACT})
74+
end
75+
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
76+
return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.spconfilter,1,nil,tp)
77+
end
78+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
79+
local c=e:GetHandler()
80+
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
81+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
82+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
83+
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_EITHER,LOCATION_ONFIELD)
84+
end
85+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
86+
local c=e:GetHandler()
87+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0
88+
and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
89+
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
90+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
91+
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
92+
if #g>0 then
93+
Duel.HintSelection(g)
94+
Duel.BreakEffect()
95+
Duel.Destroy(g,REASON_EFFECT)
96+
end
97+
end
98+
end
99+
function s.penop(e,tp,eg,ep,ev,re,r,rp)
100+
local c=e:GetHandler()
101+
if c:IsRelateToEffect(e) then
102+
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
103+
end
104+
end

0 commit comments

Comments
 (0)