Skip to content

Commit 3fbb44f

Browse files
authored
Added new card scripts
1 parent 2f16003 commit 3fbb44f

File tree

10 files changed

+1030
-0
lines changed

10 files changed

+1030
-0
lines changed

pre-release/c101304010.lua

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
--混絶獄神ヴィードリウム
2+
--Vidrium the Power Patron of Chaos Extermination
3+
--scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
Pendulum.AddProcedure(c)
8+
--Must be Special Summoned (from your face-up Extra Deck or GY) by returning 1 Fusion, 1 Synchro, and 1 Xyz Monster from your face-up field and/or GY to the Extra Deck
9+
c:AddMustBeSpecialSummoned()
10+
local e0=Effect.CreateEffect(c)
11+
e0:SetDescription(aux.Stringid(id,0))
12+
e0:SetType(EFFECT_TYPE_FIELD)
13+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
14+
e0:SetCode(EFFECT_SPSUMMON_PROC)
15+
e0:SetRange(LOCATION_EXTRA|LOCATION_GRAVE)
16+
e0:SetCondition(s.selfspcon)
17+
e0:SetTarget(s.selfsptg)
18+
e0:SetOperation(s.selfspop)
19+
c:RegisterEffect(e0)
20+
--Activate 1 of these effects
21+
local e1=Effect.CreateEffect(c)
22+
e1:SetDescription(aux.Stringid(id,1))
23+
e1:SetType(EFFECT_TYPE_IGNITION)
24+
e1:SetRange(LOCATION_PZONE)
25+
e1:SetCountLimit(1,{id,0})
26+
e1:SetTarget(s.efftg)
27+
e1:SetOperation(s.effop)
28+
c:RegisterEffect(e1)
29+
--If this card is added to your Extra Deck face-up: You can add 1 "Power Patron" card from your Deck to your hand
30+
local e2=Effect.CreateEffect(c)
31+
e2:SetDescription(aux.Stringid(id,2))
32+
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
33+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
34+
e2:SetProperty(EFFECT_FLAG_DELAY)
35+
e2:SetCode(EVENT_TO_DECK)
36+
e2:SetCountLimit(1,{id,1})
37+
e2:SetCondition(s.thcon)
38+
e2:SetTarget(s.thtg)
39+
e2:SetOperation(s.thop)
40+
c:RegisterEffect(e2)
41+
--If this card is Special Summoned: Banish (face-down) all cards from the GYs
42+
local e3=Effect.CreateEffect(c)
43+
e3:SetDescription(aux.Stringid(id,3))
44+
e3:SetCategory(CATEGORY_REMOVE)
45+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
46+
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
47+
e3:SetTarget(s.rmtg)
48+
e3:SetOperation(s.rmop)
49+
c:RegisterEffect(e3)
50+
--Unaffected by monster effects, except "Power Patron" monsters
51+
local e4=Effect.CreateEffect(c)
52+
e4:SetType(EFFECT_TYPE_SINGLE)
53+
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
54+
e4:SetCode(EFFECT_IMMUNE_EFFECT)
55+
e4:SetRange(LOCATION_MZONE)
56+
e4:SetValue(function(e,te) return te:IsMonsterEffect() and not te:GetOwner():IsSetCard(SET_POWER_PATRON) end)
57+
c:RegisterEffect(e4)
58+
end
59+
s.listed_series={SET_POWER_PATRON}
60+
local TYPES_FSX=TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ
61+
function s.tdfilter(c)
62+
return c:IsType(TYPES_FSX) and c:IsAbleToExtraAsCost()
63+
end
64+
function s.tdrescon(sg,e,tp,mg)
65+
return Duel.GetMZoneCount(tp,sg)>0 and sg:GetBitwiseOr(Card.GetType)&TYPES_FSX==TYPES_FSX
66+
end
67+
function s.selfspcon(e,c)
68+
if c==nil then return true end
69+
local tp=e:GetHandlerPlayer()
70+
local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil)
71+
return aux.SelectUnselectGroup(g,e,tp,3,3,s.tdrescon,0)
72+
end
73+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
74+
local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil)
75+
local rg=aux.SelectUnselectGroup(g,e,tp,3,3,s.tdrescon,1,tp,HINTMSG_TODECK,nil,nil,true)
76+
if #rg~=3 then return false end
77+
e:SetLabelObject(rg)
78+
return true
79+
end
80+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c)
81+
local g=e:GetLabelObject()
82+
Duel.HintSelection(g)
83+
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
84+
end
85+
function s.spfilter(c,e,tp)
86+
return c:IsSetCard(SET_POWER_PATRON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
87+
end
88+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
89+
if chk==0 then return true end
90+
local b1=Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp)
91+
local op=Duel.SelectEffect(tp,
92+
{b1,aux.Stringid(id,4)},
93+
{true,aux.Stringid(id,5)})
94+
e:SetLabel(op)
95+
local c=e:GetHandler()
96+
if op==1 then
97+
e:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
98+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,tp,0)
99+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
100+
elseif op==2 then
101+
e:SetCategory(CATEGORY_DESTROY)
102+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,tp,0)
103+
end
104+
end
105+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
106+
local c=e:GetHandler()
107+
local op=e:GetLabel()
108+
if op==1 then
109+
--Destroy this card, and if you do, Special Summon 1 "Power Patron" monster from your hand or GY
110+
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 and Duel.GetMZoneCount(tp)>0 then
111+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
112+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp)
113+
if #g>0 then
114+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
115+
end
116+
end
117+
elseif op==2 then
118+
--Destroy this card, also this turn, "Power Patron" monsters you control whose original Level is 12 gain 5000 ATK
119+
if c:IsRelateToEffect(e) then
120+
Duel.Destroy(c,REASON_EFFECT)
121+
end
122+
aux.RegisterClientHint(c,nil,tp,1,0,aux.Stringid(id,6))
123+
--"Power Patron" monsters you control whose original Level is 12 gain 5000 ATK
124+
local e1=Effect.CreateEffect(c)
125+
e1:SetType(EFFECT_TYPE_FIELD)
126+
e1:SetCode(EFFECT_UPDATE_ATTACK)
127+
e1:SetTargetRange(LOCATION_MZONE,0)
128+
e1:SetTarget(function(e,c) return c:IsSetCard(SET_POWER_PATRON) and c:IsOriginalLevel(12) end)
129+
e1:SetValue(5000)
130+
e1:SetReset(RESET_PHASE|PHASE_END)
131+
Duel.RegisterEffect(e1,tp)
132+
end
133+
end
134+
function s.thcon(e)
135+
local c=e:GetHandler()
136+
return c:IsLocation(LOCATION_EXTRA) and c:IsFaceup()
137+
end
138+
function s.thfilter(c)
139+
return c:IsSetCard(SET_POWER_PATRON) and c:IsAbleToHand()
140+
end
141+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
142+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
143+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
144+
end
145+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
146+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
147+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
148+
if #g>0 then
149+
Duel.SendtoHand(g,nil,REASON_EFFECT)
150+
Duel.ConfirmCards(1-tp,g)
151+
end
152+
end
153+
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
154+
if chk==0 then return true end
155+
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,nil,POS_FACEDOWN)
156+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
157+
end
158+
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
159+
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,nil,POS_FACEDOWN)
160+
if #g>0 then
161+
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
162+
end
163+
end

pre-release/c101304011.lua

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
--獄神影獣-ネルヴェド
2+
--Power Patron Shadow Beast Nervedo
3+
--scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
Pendulum.AddProcedure(c)
7+
--When a monster effect activated by your opponent in response to the activation of your "Power Patron" or "Artmage" monster's effect resolves, you can negate that effect, then destroy this card
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
10+
e1:SetCode(EVENT_CHAIN_SOLVING)
11+
e1:SetRange(LOCATION_PZONE)
12+
e1:SetCondition(s.discon)
13+
e1:SetOperation(s.disop)
14+
c:RegisterEffect(e1)
15+
--You can banish (face-down) the top 3 cards of your Deck; destroy this card, and if you do, Special Summon 1 "Nerva the Power Patron of Creation" from your Extra Deck (this is treated as a Fusion Summon)
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,0))
18+
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
19+
e2:SetType(EFFECT_TYPE_IGNITION)
20+
e2:SetRange(LOCATION_MZONE)
21+
e2:SetCountLimit(1,{id,0})
22+
e2:SetCost(s.descost)
23+
e2:SetTarget(s.destg)
24+
e2:SetOperation(s.desop)
25+
c:RegisterEffect(e2)
26+
--If this card is added to your Extra Deck face-up: You can Special Summon 1 "Power Patron" or "Artmage" monster from your Deck or face-up Extra Deck, except "Power Patron Shadow Beast Nervedo"
27+
local e3=Effect.CreateEffect(c)
28+
e3:SetDescription(aux.Stringid(id,1))
29+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
30+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
31+
e3:SetProperty(EFFECT_FLAG_DELAY)
32+
e3:SetCode(EVENT_TO_DECK)
33+
e3:SetCountLimit(1,{id,1})
34+
e3:SetCondition(s.spcon)
35+
e3:SetTarget(s.sptg)
36+
e3:SetOperation(s.spop)
37+
c:RegisterEffect(e3)
38+
end
39+
s.listed_names={id,53589300} --"Nerva the Power Patron of Creation"
40+
s.listed_series={SET_POWER_PATRON,SET_ARTMAGE}
41+
function s.discon(e,tp,eg,ep,ev,re,r,rp)
42+
local ch=Duel.GetCurrentChain()-1
43+
if not (ch>0 and ep==1-tp and re:IsMonsterEffect() and Duel.IsChainDisablable(ev) and not Duel.HasFlagEffect(tp,id)) then return false end
44+
local ctrl,setcodes,trig_eff=Duel.GetChainInfo(ch,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_SETCODES,CHAININFO_TRIGGERING_EFFECT)
45+
if ctrl~=tp or not trig_eff:IsMonsterEffect() then return false end
46+
for _,set in ipairs(setcodes) do
47+
if (SET_POWER_PATRON&0xfff)==(set&0xfff) and (SET_POWER_PATRON&set)==SET_POWER_PATRON then return true end
48+
if (SET_ARTMAGE&0xfff)==(set&0xfff) and (SET_ARTMAGE&set)==SET_ARTMAGE then return true end
49+
end
50+
end
51+
function s.disop(e,tp,eg,ep,ev,re,r,rp)
52+
local c=e:GetHandler()
53+
if not Duel.SelectEffectYesNo(tp,c,aux.Stringid(id,2)) then return end
54+
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1)
55+
Duel.Hint(HINT_CARD,0,id)
56+
if Duel.NegateEffect(ev) then
57+
Duel.BreakEffect()
58+
Duel.Destroy(c,REASON_EFFECT)
59+
end
60+
end
61+
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
62+
local g=Duel.GetDecktopGroup(tp,3)
63+
if chk==0 then return g:IsExists(Card.IsAbleToRemoveAsCost,3,nil,POS_FACEDOWN) end
64+
Duel.DisableShuffleCheck()
65+
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
66+
end
67+
function s.nervaspfilter(c,e,tp,hc)
68+
return c:IsCode(53589300) and Duel.GetLocationCountFromEx(tp,tp,hc,c)>0
69+
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
70+
end
71+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
72+
local c=e:GetHandler()
73+
if chk==0 then return Duel.IsExistingMatchingCard(s.nervaspfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
74+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,tp,0)
75+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
76+
end
77+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
78+
local c=e:GetHandler()
79+
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 then return end
80+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
81+
local sc=Duel.SelectMatchingCard(tp,s.nervaspfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
82+
if not sc then return end
83+
sc:SetMaterial(nil)
84+
if Duel.SpecialSummon(sc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)>0 then
85+
sc:CompleteProcedure()
86+
end
87+
end
88+
function s.spcon(e)
89+
local c=e:GetHandler()
90+
return c:IsLocation(LOCATION_EXTRA) and c:IsFaceup()
91+
end
92+
function s.spfilter(c,e,tp)
93+
if not c:IsSetCard({SET_POWER_PATRON,SET_ARTMAGE}) or c:IsCode(id) or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return false end
94+
if c:IsLocation(LOCATION_DECK) then
95+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
96+
else
97+
return c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
98+
end
99+
end
100+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
101+
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_EXTRA,0,1,nil,e,tp) end
102+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_EXTRA)
103+
end
104+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
105+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
106+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|LOCATION_EXTRA,0,1,1,nil,e,tp)
107+
if #g>0 then
108+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
109+
end
110+
end

0 commit comments

Comments
 (0)