Skip to content

Commit 3302cc1

Browse files
authored
Added new card scripts
1 parent 7ba9a5d commit 3302cc1

File tree

3 files changed

+280
-0
lines changed

3 files changed

+280
-0
lines changed

pre-release/c101303082.lua

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
--JP name
2+
--Jade Dragon Mech
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Synchro Summon procedure: 1 Tuner + 1+ non-Tuners
8+
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
9+
--If this card is Special Summoned: You can send 1 Machine Tuner from your Deck to the GY, or if you control a monster whose current Level is different from its original Level, you can Special Summon it instead
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
13+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
14+
e1:SetProperty(EFFECT_FLAG_DELAY)
15+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
16+
e1:SetCountLimit(1,id)
17+
e1:SetTarget(s.tgsptg)
18+
e1:SetOperation(s.tgspop)
19+
c:RegisterEffect(e1)
20+
--If this Synchro Summoned card is destroyed by card effect and sent to the GY: You can banish any number of Tuners from your GY, then target that many cards on the field; destroy them
21+
local e2=Effect.CreateEffect(c)
22+
e2:SetDescription(aux.Stringid(id,1))
23+
e2:SetCategory(CATEGORY_DESTROY)
24+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
25+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
26+
e2:SetCode(EVENT_TO_GRAVE)
27+
e2:SetCondition(s.descon)
28+
e2:SetCost(s.descost)
29+
e2:SetTarget(s.destg)
30+
e2:SetOperation(s.desop)
31+
c:RegisterEffect(e2)
32+
end
33+
function s.difflvfilter(c)
34+
return c:HasLevel() and c:IsFaceup() and not c:IsLevel(c:GetOriginalLevel())
35+
end
36+
function s.tgspfilter(c,e,tp,mmz_extra_chk)
37+
return c:IsRace(RACE_MACHINE) and (c:IsAbleToGrave() or (mmz_extra_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
38+
end
39+
function s.tgsptg(e,tp,eg,ep,ev,re,r,rp,chk)
40+
local mmz_extra_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
41+
and Duel.IsExistingMatchingCard(s.difflvfilter,tp,LOCATION_MZONE,0,1,nil)
42+
if chk==0 then return Duel.IsExistingMatchingCard(s.tgspfilter,tp,LOCATION_DECK,0,1,nil,e,tp,mmz_extra_chk) end
43+
if not mmz_extra_chk then
44+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
45+
else
46+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
47+
end
48+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
49+
end
50+
function s.tgspop(e,tp,eg,ep,ev,re,r,rp)
51+
local mmz_extra_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
52+
and Duel.IsExistingMatchingCard(s.difflvfilter,tp,LOCATION_MZONE,0,1,nil)
53+
local hint=mmz_extra_chk and aux.Stringid(id,2) or HINTMSG_TOGRAVE
54+
Duel.Hint(HINT_SELECTMSG,tp,hint)
55+
local sc=Duel.SelectMatchingCard(tp,s.tgspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mmz_extra_chk):GetFirst()
56+
if not sc then return end
57+
local op=1
58+
if mmz_extra_chk then
59+
local b1=sc:IsAbleToGrave()
60+
local b2=sc:IsCanBeSpecialSummoned(e,0,tp,false,false)
61+
op=Duel.SelectEffect(tp,
62+
{b1,aux.Stringid(id,3)},
63+
{b2,aux.Stringid(id,4)})
64+
end
65+
if op==1 then
66+
Duel.SendtoGrave(sc,REASON_EFFECT)
67+
elseif op==2 then
68+
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
69+
end
70+
end
71+
function s.descon(e,tp,eg,ep,ev,re,r,rp)
72+
local c=e:GetHandler()
73+
return c:IsSynchroSummoned() and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_EFFECT)
74+
end
75+
function s.descostfilter(c)
76+
return c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost()
77+
end
78+
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
79+
if chk==0 then return Duel.IsExistingMatchingCard(s.descostfilter,tp,LOCATION_GRAVE,0,1,nil) end
80+
local max_target_count=Duel.GetTargetCount(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
81+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
82+
local g=Duel.SelectMatchingCard(tp,s.descostfilter,tp,LOCATION_GRAVE,0,1,max_target_count,nil)
83+
Duel.Remove(g,POS_FACEUP,REASON_COST)
84+
e:SetLabel(#g)
85+
end
86+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
87+
if chkc then return chkc:IsOnField() end
88+
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
89+
local target_count=e:GetLabel()
90+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
91+
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,target_count,target_count,nil)
92+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
93+
end
94+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
95+
local tg=Duel.GetTargetCards(e)
96+
if #tg>0 then
97+
Duel.Destroy(tg,REASON_EFFECT)
98+
end
99+
end

pre-release/c101303085.lua

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
--JP name
2+
--Vodnika the Fountain Spirit
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If a Level 10 monster(s) is sent to the GY, except "Vodnika the Fountain Spirit" (except during the Damage Step): You can Special Summon this card from your GY (if it was there when the monster was sent) or hand (even if not) in Defense Position, but banish it when it leaves the field
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
10+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS)
12+
e1:SetCode(EVENT_TO_GRAVE)
13+
e1:SetRange(LOCATION_GRAVE|LOCATION_HAND)
14+
e1:SetCountLimit(1,{id,0})
15+
e1:SetCondition(s.selfspcon)
16+
e1:SetTarget(s.selfsptg)
17+
e1:SetOperation(s.selfspop)
18+
c:RegisterEffect(e1)
19+
--You can target 1 Level 10 monster in your GY; Special Summon it to your opponent's field (but negate its effects), then draw 1 card
20+
local e2=Effect.CreateEffect(c)
21+
e2:SetDescription(aux.Stringid(id,1))
22+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE+CATEGORY_DRAW)
23+
e2:SetType(EFFECT_TYPE_IGNITION)
24+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
25+
e2:SetRange(LOCATION_MZONE)
26+
e2:SetCountLimit(1,{id,1})
27+
e2:SetTarget(s.gysptg)
28+
e2:SetOperation(s.gyspop)
29+
c:RegisterEffect(e2)
30+
end
31+
s.listed_names={id}
32+
function s.selfspconfilter(c)
33+
return c:IsLevel(10) and not c:IsCode(id)
34+
end
35+
function s.selfspcon(e,tp,eg,ep,ev,re,r,rp)
36+
return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.selfspconfilter,1,nil)
37+
end
38+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
39+
local c=e:GetHandler()
40+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
41+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
42+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
43+
Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE)
44+
end
45+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
46+
local c=e:GetHandler()
47+
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
48+
--Banish it when it leaves the field
49+
local e1=Effect.CreateEffect(c)
50+
e1:SetDescription(3300)
51+
e1:SetType(EFFECT_TYPE_SINGLE)
52+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
53+
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
54+
e1:SetValue(LOCATION_REMOVED)
55+
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
56+
c:RegisterEffect(e1)
57+
end
58+
Duel.SpecialSummonComplete()
59+
end
60+
function s.gyspfilter(c,e,tp)
61+
return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
62+
end
63+
function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
64+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.gyspfilter(chkc,e,tp) end
65+
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
66+
and Duel.IsExistingTarget(s.gyspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
67+
and Duel.IsPlayerCanDraw(tp,1) end
68+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
69+
local g=Duel.SelectTarget(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
70+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
71+
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
72+
Duel.SetPossibleOperationInfo(0,CATEGORY_DISABLE,nil,1,tp,LOCATION_MZONE)
73+
end
74+
function s.gyspop(e,tp,eg,ep,ev,re,r,rp)
75+
local tc=Duel.GetFirstTarget()
76+
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP) then
77+
--Negate its effects
78+
tc:NegateEffects(e:GetHandler())
79+
end
80+
if Duel.SpecialSummonComplete()>0 and Duel.IsPlayerCanDraw(tp) then
81+
Duel.BreakEffect()
82+
Duel.Draw(tp,1,REASON_EFFECT)
83+
end
84+
end

pre-release/c101303088.lua

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
--JP name
2+
--Shipping Archfiend
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--You can target any number of face-up monsters on the field, and declare 1 Type or Attribute; they become that Type or Attribute
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_IGNITION)
10+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
11+
e1:SetRange(LOCATION_MZONE)
12+
e1:SetCountLimit(1,{id,0})
13+
e1:SetTarget(s.changetg)
14+
e1:SetOperation(s.changeop)
15+
c:RegisterEffect(e1)
16+
--If a monster(s) is Special Summoned to your opponent's field, while this card is in your Monster Zone (except during the Damage Step): You can target 1 monster on each field with the same Type and Attribute from each other; return them to the hand
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetDescription(aux.Stringid(id,1))
19+
e2:SetCategory(CATEGORY_TOHAND)
20+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
21+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET,EFFECT_FLAG2_CHECK_SIMULTANEOUS)
22+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
23+
e2:SetRange(LOCATION_MZONE)
24+
e2:SetCountLimit(1,{id,1})
25+
e2:SetCondition(function(e,tp,eg) return not eg:IsContains(e:GetHandler()) and eg:IsExists(Card.IsControler,1,nil,1-tp) end)
26+
e2:SetTarget(s.rthtg)
27+
e2:SetOperation(s.rthop)
28+
c:RegisterEffect(e2)
29+
end
30+
function s.single_property_filter(c,func)
31+
local property=func(c)
32+
return property&(property-1)==0
33+
end
34+
function s.get_excluded_values(tg,func)
35+
return tg:Filter(s.single_property_filter,nil,func):GetBitwiseOr(func)
36+
end
37+
function s.changetg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
38+
if chkc then
39+
if not (chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()) then return false end
40+
local op,val=e:GetLabel()
41+
return (op==1 and chkc:IsRaceExcept(val)) or (op==2 and chkc:IsAttributeExcept(val))
42+
end
43+
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
44+
local max_target_count=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)
45+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
46+
local tg=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,max_target_count,nil)
47+
local excluded_races=s.get_excluded_values(tg,Card.GetRace)
48+
local excluded_attributes=s.get_excluded_values(tg,Card.GetAttribute)
49+
local b1=(excluded_races&RACE_ALL)~=RACE_ALL
50+
local b2=(excluded_attributes&ATTRIBUTE_ALL)~=ATTRIBUTE_ALL
51+
local op=Duel.SelectEffect(tp,
52+
{b1,aux.Stringid(id,2)},
53+
{b2,aux.Stringid(id,3)})
54+
local decl_race_attr=0
55+
if op==1 then
56+
decl_race_attr=Duel.AnnounceRace(tp,1,RACE_ALL&~excluded_races)
57+
elseif op==2 then
58+
decl_race_attr=Duel.AnnounceAttribute(tp,1,ATTRIBUTE_ALL&~excluded_attributes)
59+
end
60+
e:SetLabel(op,decl_race_attr)
61+
end
62+
function s.changeop(e,tp,eg,ep,ev,re,r,rp)
63+
local tg=Duel.GetTargetCards(e):Match(Card.IsFaceup,nil)
64+
if #tg==0 then return end
65+
local c=e:GetHandler()
66+
local op,decl_race_attr=e:GetLabel()
67+
local eff_code=op==1 and EFFECT_CHANGE_RACE or EFFECT_CHANGE_ATTRIBUTE
68+
for tc in tg:Iter() do
69+
--They become that Type or Attribute
70+
local e1=Effect.CreateEffect(c)
71+
e1:SetType(EFFECT_TYPE_SINGLE)
72+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
73+
e1:SetCode(eff_code)
74+
e1:SetValue(decl_race_attr)
75+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
76+
tc:RegisterEffect(e1)
77+
end
78+
end
79+
function s.rescon(sg,e,tp,mg)
80+
return #sg==2 and sg:GetClassCount(Card.GetControler)==2
81+
and sg:GetClassCount(Card.GetRace)==1
82+
and sg:GetClassCount(Card.GetAttribute)==1
83+
end
84+
function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
85+
if chkc then return false end
86+
local g=Duel.GetTargetGroup(aux.FaceupFilter(Card.IsAbleToHand),tp,LOCATION_MZONE,LOCATION_MZONE,nil)
87+
if chk==0 then return #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end
88+
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_RTOHAND)
89+
Duel.SetTargetCard(tg)
90+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,2,tp,0)
91+
end
92+
function s.rthop(e,tp,eg,ep,ev,re,r,rp)
93+
local tg=Duel.GetTargetCards(e)
94+
if #tg>0 then
95+
Duel.SendtoHand(tg,nil,REASON_EFFECT)
96+
end
97+
end

0 commit comments

Comments
 (0)