Skip to content

Commit e00d46e

Browse files
authored
Added new card scripts
1 parent cf41515 commit e00d46e

2 files changed

Lines changed: 251 additions & 0 deletions

File tree

pre-release/c100451015.lua

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
--星霜の魔術師-アストログラフ・マジシャン
2+
--Astrograph Sorcerer, the Star Magician
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
Pendulum.AddProcedure(c)
7+
--During your Main Phase: You can destroy this card, and if you do, place 1 Pendulum Monster whose Pendulum Scale is 1 from your hand or Deck in your Pendulum Zone, except "Astrograph Sorcerer, the Star Magician", but it cannot activate its Pendulum Effects this turn
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetDescription(aux.Stringid(id,0))
10+
e1:SetCategory(CATEGORY_DESTROY)
11+
e1:SetType(EFFECT_TYPE_IGNITION)
12+
e1:SetRange(LOCATION_PZONE)
13+
e1:SetCountLimit(1,{id,0})
14+
e1:SetTarget(s.pltg)
15+
e1:SetOperation(s.plop)
16+
c:RegisterEffect(e1)
17+
--If a face-up Monster Card(s) you control is destroyed by battle or card effect: You can Special Summon this card from your hand, then you can Special Summon 1 of those destroyed monsters from your GY or face-up Extra Deck
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
21+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
22+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
23+
e2:SetCode(EVENT_CUSTOM+id)
24+
e2:SetRange(LOCATION_HAND)
25+
e2:SetCountLimit(1,{id,1})
26+
e2:SetTarget(s.sptg)
27+
e2:SetOperation(s.spop)
28+
c:RegisterEffect(e2)
29+
--Keep track of the destroyed monsters
30+
aux.GlobalCheck(s,function()
31+
s.desgroup=Group.CreateGroup()
32+
local ge1=Effect.CreateEffect(c)
33+
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
34+
ge1:SetCode(EVENT_DESTROYED)
35+
ge1:SetOperation(s.desgroupregop)
36+
Duel.RegisterEffect(ge1,0)
37+
end)
38+
--During the Main Phase (Quick Effect): You can Tribute this card, then you can Fusion Summon 1 Dragon Fusion Monster from your Extra Deck, by shuffling its materials from your field and/or face-up Extra Deck into the Deck
39+
local e3=Effect.CreateEffect(c)
40+
e3:SetDescription(aux.Stringid(id,2))
41+
e3:SetCategory(CATEGORY_RELEASE+CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
42+
e3:SetType(EFFECT_TYPE_QUICK_O)
43+
e3:SetCode(EVENT_FREE_CHAIN)
44+
e3:SetRange(LOCATION_MZONE)
45+
e3:SetCountLimit(1,{id,2})
46+
e3:SetCondition(function() return Duel.IsMainPhase() end)
47+
e3:SetTarget(s.tribtg)
48+
e3:SetOperation(s.tribop)
49+
e3:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
50+
c:RegisterEffect(e3)
51+
end
52+
s.listed_names={id}
53+
function s.plfilter(c)
54+
return c:IsPendulumMonster() and c:IsScale(1) and not c:IsCode(id) and not c:IsForbidden()
55+
end
56+
function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
57+
if chk==0 then return Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil) end
58+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,tp,0)
59+
end
60+
function s.plop(e,tp,eg,ep,ev,re,r,rp)
61+
local c=e:GetHandler()
62+
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 and Duel.CheckPendulumZones(tp) then
63+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
64+
local sc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil):GetFirst()
65+
if sc and Duel.MoveToField(sc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then
66+
--It cannot activate its Pendulum Effects this turn
67+
local e1=Effect.CreateEffect(c)
68+
e1:SetDescription(3302)
69+
e1:SetType(EFFECT_TYPE_SINGLE)
70+
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
71+
e1:SetCode(EFFECT_CANNOT_TRIGGER)
72+
e1:SetReset(RESETS_STANDARD_PHASE_END)
73+
sc:RegisterEffect(e1)
74+
end
75+
end
76+
end
77+
function s.spconfilter(c)
78+
return c:IsMonsterCard() and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
79+
and c:IsReason(REASON_BATTLE|REASON_EFFECT)
80+
end
81+
function s.desgroupregop(e,tp,eg,ep,ev,re,r,rp)
82+
local tg=eg:Filter(s.spconfilter,nil)
83+
if #tg>0 then
84+
for tc in tg:Iter() do
85+
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
86+
end
87+
if Duel.GetCurrentChain()==0 then s.desgroup:Clear() end
88+
s.desgroup:Merge(tg)
89+
s.desgroup:Remove(function(c) return not c:HasFlagEffect(id) end,nil)
90+
if tg:IsExists(Card.IsPreviousControler,1,nil,0) then
91+
local g=s.desgroup:Filter(Card.IsPreviousControler,nil,0)
92+
Duel.RaiseEvent(g,EVENT_CUSTOM+id,re,r,rp,0,ev)
93+
end
94+
if tg:IsExists(Card.IsPreviousControler,1,nil,1) then
95+
local g=s.desgroup:Filter(Card.IsPreviousControler,nil,1)
96+
Duel.RaiseEvent(g,EVENT_CUSTOM+id,re,r,rp,1,ev)
97+
end
98+
end
99+
end
100+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
101+
local c=e:GetHandler()
102+
if chk==0 then return ep==tp and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
103+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
104+
local g=s.desgroup:Filter(s.spconfilter,nil)
105+
e:SetLabelObject(g)
106+
for ec in g:Iter() do
107+
ec:CreateEffectRelation(e)
108+
end
109+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
110+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
111+
end
112+
function s.spfilter(c,e,tp,mmz_chk)
113+
if not (c:IsControler(tp) and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then return false end
114+
if c:IsLocation(LOCATION_GRAVE) then
115+
return mmz_chk
116+
elseif c:IsLocation(LOCATION_EXTRA) then
117+
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
118+
end
119+
return false
120+
end
121+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
122+
local c=e:GetHandler()
123+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
124+
local mmz_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
125+
local g=e:GetLabelObject():Filter(aux.NecroValleyFilter(s.spfilter),nil,e,tp,mmz_chk)
126+
if #g==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,3)) then return end
127+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
128+
local sg=g:Select(tp,1,1,nil)
129+
if #sg>0 then
130+
Duel.BreakEffect()
131+
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
132+
end
133+
end
134+
end
135+
function s.tribtg(e,tp,eg,ep,ev,re,r,rp,chk)
136+
local c=e:GetHandler()
137+
if chk==0 then return c:IsReleasableByEffect() end
138+
Duel.SetOperationInfo(0,CATEGORY_RELEASE,c,1,tp,0)
139+
Duel.SetPossibleOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD|LOCATION_EXTRA)
140+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
141+
end
142+
function s.tribop(e,tp,eg,ep,ev,re,r,rp)
143+
local c=e:GetHandler()
144+
if c:IsRelateToEffect(e) and Duel.Release(c,REASON_EFFECT)>0 then
145+
local fusion_params={
146+
fusfilter=function(c) return c:IsRace(RACE_DRAGON) end,
147+
extraop=Fusion.ShuffleMaterial,
148+
matfilter=Fusion.OnFieldMat,
149+
extrafil=function(e,tp,mg)
150+
return Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAbleToDeck),tp,LOCATION_EXTRA,0,nil)
151+
end
152+
}
153+
if Fusion.SummonEffTG(fusion_params)(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
154+
Duel.BreakEffect()
155+
Fusion.SummonEffOP(fusion_params)(e,tp,eg,ep,ev,re,r,rp)
156+
end
157+
end
158+
end

pre-release/c100451018.lua

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
--サイバース・コントラクト・ウィッチ
2+
--Cyberse Contract Witch
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Link Summon procedure: 2 monsters with the same Type
8+
Link.AddProcedure(c,nil,2,nil,s.matcheck)
9+
--If this card is Link Summoned, or a monster(s) is Special Summoned to a zone(s) this card points to: You can send 1 Spell from your hand or face-up field to the GY; add 1 Ritual Monster from your Deck to your hand
10+
local e1a=Effect.CreateEffect(c)
11+
e1a:SetDescription(aux.Stringid(id,0))
12+
e1a:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
13+
e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
14+
e1a:SetProperty(EFFECT_FLAG_DELAY)
15+
e1a:SetCode(EVENT_SPSUMMON_SUCCESS)
16+
e1a:SetCountLimit(1,{id,0})
17+
e1a:SetCondition(function(e) return e:GetHandler():IsLinkSummoned() end)
18+
e1a:SetCost(s.thcost)
19+
e1a:SetTarget(s.thtg)
20+
e1a:SetOperation(s.thop)
21+
c:RegisterEffect(e1a)
22+
local e1b=e1a:Clone()
23+
e1b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
24+
e1b:SetRange(LOCATION_MZONE)
25+
e1b:SetCondition(aux.zptcon(nil))
26+
c:RegisterEffect(e1b)
27+
--You can target 1 Ritual, Fusion, Synchro, or Xyz Monster this card points to; Special Summon 1 monster from your GY with the same Type but a different card type (Ritual, Fusion, Synchro, or Xyz)
28+
local e2=Effect.CreateEffect(c)
29+
e2:SetDescription(aux.Stringid(id,1))
30+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
31+
e2:SetType(EFFECT_TYPE_IGNITION)
32+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
33+
e2:SetRange(LOCATION_MZONE)
34+
e2:SetCountLimit(1,{id,1})
35+
e2:SetTarget(s.sptg)
36+
e2:SetOperation(s.spop)
37+
c:RegisterEffect(e2)
38+
end
39+
local TYPES_RITUAL_FUSION_SYNCHRO_XYZ=TYPE_RITUAL|TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ
40+
function s.matcheck(g,lc,sumtype,tp)
41+
return g:CheckSameProperty(Card.GetRace,lc,sumtype,tp)
42+
end
43+
function s.thcostfilter(c)
44+
return c:IsSpell() and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsAbleToGraveAsCost()
45+
end
46+
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
47+
if chk==0 then return Duel.IsExistingMatchingCard(s.thcostfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,nil) end
48+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
49+
local g=Duel.SelectMatchingCard(tp,s.thcostfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,nil)
50+
Duel.SendtoGrave(g,REASON_COST)
51+
end
52+
function s.thfilter(c)
53+
return c:IsRitualMonster() and c:IsAbleToHand()
54+
end
55+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
56+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
57+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
58+
end
59+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
60+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
61+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
62+
if #g>0 then
63+
Duel.SendtoHand(g,nil,REASON_EFFECT)
64+
Duel.ConfirmCards(1-tp,g)
65+
end
66+
end
67+
function s.tgfilter(c,e,tp,lg)
68+
return c:IsType(TYPES_RITUAL_FUSION_SYNCHRO_XYZ) and lg:IsContains(c) and c:IsFaceup()
69+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetRace(),c:GetType()&TYPES_RITUAL_FUSION_SYNCHRO_XYZ)
70+
end
71+
function s.spfilter(c,e,tp,race,card_type)
72+
return c:IsType(TYPES_RITUAL_FUSION_SYNCHRO_XYZ) and c:IsRace(race) and not c:IsType(card_type)
73+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
74+
end
75+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
76+
local lg=e:GetHandler():GetLinkedGroup()
77+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc,e,tp,lg) end
78+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
79+
and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,lg) end
80+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
81+
local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,lg)
82+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
83+
end
84+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
85+
local tc=Duel.GetFirstTarget()
86+
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
87+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
88+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,tc:GetRace(),tc:GetType()&TYPES_RITUAL_FUSION_SYNCHRO_XYZ)
89+
if #g>0 then
90+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
91+
end
92+
end
93+
end

0 commit comments

Comments
 (0)