Skip to content

Commit d100052

Browse files
authored
Added new card scripts
1 parent 7e91edb commit d100052

7 files changed

Lines changed: 770 additions & 0 deletions

File tree

‎pre-release/c100462003.lua‎

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
--聖魔の賢王エンディミオン
2+
--Endymion, the Lord of Magistus
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
Pendulum.AddProcedure(c)
8+
c:EnableCounterPermit(COUNTER_SPELL,LOCATION_PZONE)
9+
--Must be Special Summoned (from your hand or Extra Deck) by banishing 1 face-up Spell you control. You can only Special Summon "Endymion, the Lord of Magistus" once per turn this way
10+
c:AddMustBeSpecialSummoned()
11+
local e0=Effect.CreateEffect(c)
12+
e0:SetDescription(aux.Stringid(id,0))
13+
e0:SetType(EFFECT_TYPE_FIELD)
14+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
15+
e0:SetCode(EFFECT_SPSUMMON_PROC)
16+
e0:SetRange(LOCATION_HAND|LOCATION_EXTRA)
17+
e0:SetCountLimit(1,{id,0},EFFECT_COUNT_CODE_OATH)
18+
e0:SetCondition(s.selfspcon)
19+
e0:SetTarget(s.selfsptg)
20+
e0:SetOperation(s.selfspop)
21+
c:RegisterEffect(e0)
22+
--Each time a Spell Card is activated, place 1 Spell Counter on this card when it resolves
23+
local e1a=Effect.CreateEffect(c)
24+
e1a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
25+
e1a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
26+
e1a:SetCode(EVENT_CHAINING)
27+
e1a:SetRange(LOCATION_PZONE)
28+
e1a:SetOperation(aux.chainreg)
29+
c:RegisterEffect(e1a)
30+
local e1b=Effect.CreateEffect(c)
31+
e1b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
32+
e1b:SetCode(EVENT_CHAIN_SOLVED)
33+
e1b:SetRange(LOCATION_PZONE)
34+
e1b:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
35+
local c=e:GetHandler()
36+
if re:IsSpellEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and c:HasFlagEffect(1) then
37+
c:AddCounter(COUNTER_SPELL,1)
38+
end
39+
end)
40+
c:RegisterEffect(e1b)
41+
--During your Main Phase: You can destroy this card, and if you do, add 1 "Magistus" or "Endymion" monster from your Deck to your hand, except a Level 7 monster. You can only use this effect of "Endymion, the Lord of Magistus" once per turn
42+
local e2=Effect.CreateEffect(c)
43+
e2:SetDescription(aux.Stringid(id,1))
44+
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
45+
e2:SetType(EFFECT_TYPE_IGNITION)
46+
e2:SetRange(LOCATION_PZONE)
47+
e2:SetCountLimit(1,{id,1})
48+
e2:SetTarget(s.thtg)
49+
e2:SetOperation(s.thop)
50+
c:RegisterEffect(e2)
51+
--Cannot be destroyed by battle or card effects while equipped with an Equip Card
52+
local e3a=Effect.CreateEffect(c)
53+
e3a:SetType(EFFECT_TYPE_SINGLE)
54+
e3a:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
55+
e3a:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
56+
e3a:SetRange(LOCATION_MZONE)
57+
e3a:SetCondition(function(e)
58+
return e:GetHandler():HasEquipCard()
59+
end)
60+
e3a:SetValue(1)
61+
c:RegisterEffect(e3a)
62+
local e3b=e3a:Clone()
63+
e3b:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
64+
c:RegisterEffect(e3b)
65+
--At the end of the Damage Step, if this card attacked: You can banish 1 face-up Spell you control, or remove 3 Spell Counters from your field; this card gains 500 ATK, also it can attack again in a row
66+
local e4=Effect.CreateEffect(c)
67+
e4:SetDescription(aux.Stringid(id,2))
68+
e4:SetCategory(CATEGORY_ATKCHANGE)
69+
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
70+
e4:SetCode(EVENT_DAMAGE_STEP_END)
71+
e4:SetCondition(s.atkcon)
72+
e4:SetCost(s.atkcost)
73+
e4:SetOperation(s.atkop)
74+
c:RegisterEffect(e4)
75+
end
76+
s.listed_series={SET_MAGISTUS,SET_ENDYMION}
77+
s.listed_names={id}
78+
function s.spellcostfilter(c)
79+
return c:IsSpell() and c:IsFaceup() and c:IsAbleToRemoveAsCost()
80+
end
81+
function s.selfspconfilter(c,hand_chk,tp,endymion)
82+
return s.spellcostfilter(c) and ((hand_chk and Duel.GetMZoneCount(tp,c)>0)
83+
or Duel.GetLocationCountFromEx(tp,tp,c,endymion)>0)
84+
end
85+
function s.selfspcon(e,c)
86+
if c==nil then return true end
87+
local tp=c:GetControler()
88+
local hand_chk=c:IsLocation(LOCATION_HAND)
89+
return Duel.IsExistingMatchingCard(s.selfspconfilter,tp,LOCATION_ONFIELD,0,1,nil,hand_chk,tp,c)
90+
end
91+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
92+
local hand_chk=c:IsLocation(LOCATION_HAND)
93+
local rg=Duel.GetMatchingGroup(s.selfspconfilter,tp,LOCATION_ONFIELD,0,nil,hand_chk,tp,c)
94+
local g=aux.SelectUnselectGroup(rg,e,tp,1,1,nil,1,tp,HINTMSG_REMOVE,nil,nil,true)
95+
if g and #g>0 then
96+
e:SetLabelObject(g)
97+
return true
98+
end
99+
return false
100+
end
101+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c)
102+
local g=e:GetLabelObject()
103+
if g and #g>0 then
104+
Duel.Remove(g,POS_FACEUP,REASON_COST)
105+
end
106+
end
107+
function s.thfilter(c)
108+
return c:IsSetCard({SET_MAGISTUS,SET_ENDYMION}) and c:IsMonster() and not c:IsLevel(7) and c:IsAbleToHand()
109+
end
110+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
111+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
112+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,tp,0)
113+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
114+
end
115+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
116+
local c=e:GetHandler()
117+
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 then
118+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
119+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
120+
if #g>0 then
121+
Duel.SendtoHand(g,nil,REASON_EFFECT)
122+
Duel.ConfirmCards(1-tp,g)
123+
end
124+
end
125+
end
126+
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
127+
local c=e:GetHandler()
128+
return Duel.GetAttacker()==c and c:CanChainAttack(0)
129+
end
130+
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
131+
--Banish 1 face-up Spell you control
132+
local option_1=Duel.IsExistingMatchingCard(s.spellcostfilter,tp,LOCATION_ONFIELD,0,1,nil)
133+
--Remove 3 Spell Counters from your field
134+
local option_2=Duel.IsCanRemoveCounter(tp,1,0,COUNTER_SPELL,3,REASON_COST)
135+
if chk==0 then return option_1 or option_2 end
136+
local choice=nil
137+
if option_1 and option_2 then
138+
choice=Duel.SelectEffect(tp,
139+
{option_1,aux.Stringid(id,3)},
140+
{option_2,aux.Stringid(id,4)})
141+
else
142+
choice=(option_1 and 1) or (option_2 and 2)
143+
end
144+
if choice==1 then
145+
--Banish 1 face-up Spell you control
146+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
147+
local g=Duel.SelectMatchingCard(tp,s.spellcostfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
148+
Duel.Remove(g,POS_FACEUP,REASON_COST)
149+
elseif choice==2 then
150+
--Remove 3 Spell Counters from your field
151+
Duel.RemoveCounter(tp,1,0,COUNTER_SPELL,3,REASON_COST)
152+
end
153+
end
154+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
155+
local c=e:GetHandler()
156+
if c:IsRelateToBattle() and c:IsRelateToEffect(e) and c:IsFaceup() then
157+
--This card gains 500 ATK
158+
c:UpdateAttack(500)
159+
--Also it can attack again in a row
160+
Duel.ChainAttack()
161+
end
162+
end

‎pre-release/c100462005.lua‎

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
--絶火の祆威
2+
--Wisprath Magistus
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Target 1 "Magistus" or Spellcaster monster you control and 1 face-up monster your opponent controls; equip that opponent's face-up monster to your monster as an Equip Spell that gives it 500 ATK
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_EQUIP+CATEGORY_ATKCHANGE)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
12+
e1:SetCode(EVENT_FREE_CHAIN)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.equiptg)
15+
e1:SetOperation(s.equipop)
16+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
17+
c:RegisterEffect(e1)
18+
--During your Main Phase, if this card is in your GY: You can target 1 Fusion, Synchro, Xyz, or Link Monster in your GY; shuffle both it and this card into the Deck
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
21+
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOEXTRA)
22+
e2:SetType(EFFECT_TYPE_IGNITION)
23+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
24+
e2:SetRange(LOCATION_GRAVE)
25+
e2:SetCountLimit(1,id)
26+
e2:SetTarget(s.tdtg)
27+
e2:SetOperation(s.tdop)
28+
c:RegisterEffect(e2)
29+
end
30+
s.listed_series={SET_MAGISTUS}
31+
function s.eqpmonsterfilter(c)
32+
return (c:IsSetCard(SET_MAGISTUS) or c:IsRace(RACE_SPELLCASTER)) and c:IsFaceup()
33+
end
34+
function s.eqpcardfilter(c,tp)
35+
return c:IsFaceup() and c:IsAbleToChangeControler() and c:CheckUniqueOnField(tp)
36+
end
37+
function s.rescon(sg,e,tp,mg)
38+
return sg:GetClassCount(Card.GetControler)==2
39+
end
40+
function s.equiptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
41+
local available_stzones=Duel.GetLocationCount(tp,LOCATION_SZONE)
42+
if e:GetHandler():IsLocation(LOCATION_HAND) then available_stzones=available_stzones-1 end
43+
if chkc then return false end
44+
if chk==0 then return available_stzones>0
45+
and Duel.IsExistingTarget(s.eqpmonsterfilter,tp,LOCATION_MZONE,0,1,nil)
46+
and Duel.IsExistingTarget(s.eqpcardfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
47+
local g=Duel.GetTargetGroup(s.eqpmonsterfilter,tp,LOCATION_MZONE,0,nil)+Duel.GetTargetGroup(s.eqpcardfilter,tp,0,LOCATION_MZONE,nil,tp)
48+
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetControler),1,tp,HINTMSG_TARGET)
49+
Duel.SetTargetCard(tg)
50+
local chain_data=e:GetChainData()
51+
chain_data.your_monster=tg:Filter(Card.IsControler,nil,tp):GetFirst()
52+
chain_data.oppo_monster=tg:Filter(Card.IsControler,nil,1-tp):GetFirst()
53+
Duel.SetOperationInfo(0,CATEGORY_EQUIP,chain_data.oppo_monster,1,tp,0)
54+
end
55+
function s.equipop(e,tp,eg,ep,ev,re,r,rp)
56+
local chain_data=e:GetChainData()
57+
local your_monster=chain_data.your_monster
58+
local oppo_monster=chain_data.oppo_monster
59+
if not (oppo_monster:IsRelateToEffect(e) and oppo_monster:IsControler(1-tp) and oppo_monster:IsFaceup()) then return end
60+
if your_monster:IsRelateToEffect(e) and your_monster:IsControler(tp) and your_monster:IsFaceup()
61+
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
62+
and Duel.Equip(tp,oppo_monster,your_monster) then
63+
--Equip limit
64+
local e0=Effect.CreateEffect(oppo_monster)
65+
e0:SetType(EFFECT_TYPE_SINGLE)
66+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
67+
e0:SetCode(EFFECT_EQUIP_LIMIT)
68+
e0:SetValue(function(e,c) return c==your_monster end)
69+
e0:SetReset(RESET_EVENT|RESETS_STANDARD)
70+
oppo_monster:RegisterEffect(e0)
71+
--Equip that opponent's face-up monster to your monster as an Equip Spell that gives it 500 ATK
72+
local e1=Effect.CreateEffect(oppo_monster)
73+
e1:SetType(EFFECT_TYPE_EQUIP)
74+
e1:SetCode(EFFECT_UPDATE_ATTACK)
75+
e1:SetValue(500)
76+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
77+
oppo_monster:RegisterEffect(e1)
78+
else
79+
Duel.SendtoGrave(oppo_monster,REASON_RULE,nil,PLAYER_NONE)
80+
end
81+
end
82+
function s.toextrafilter(c)
83+
return c:IsType(TYPE_EXTRA) and c:IsAbleToExtra()
84+
end
85+
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
86+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.toextrafilter() end
87+
local c=e:GetHandler()
88+
if chk==0 then return c:IsAbleToDeck()
89+
and Duel.IsExistingTarget(s.toextrafilter,tp,LOCATION_GRAVE,0,1,nil) end
90+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
91+
local g=Duel.SelectTarget(tp,s.toextrafilter,tp,LOCATION_GRAVE,0,1,1,nil)
92+
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,0)
93+
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,1,tp,0)
94+
end
95+
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
96+
local c=e:GetHandler()
97+
local tc=Duel.GetFirstTarget()
98+
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
99+
local g=Group.FromCards(c,tc)
100+
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
101+
end
102+
end

‎pre-release/c100462028.lua‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
--神霊の来臨
2+
--Dunamis Magistus
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Target 1 Fusion, Synchro, Xyz, or Link Monster Card you control; return it to the Extra Deck, then you can Special Summon 1 "Magistus" monster of the same type (Fusion, Synchro, Xyz, Link) from your Extra Deck
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
12+
e1:SetCode(EVENT_FREE_CHAIN)
13+
e1:SetCountLimit(1,{id,0})
14+
e1:SetTarget(s.toextratg)
15+
e1:SetOperation(s.toextraop)
16+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
17+
c:RegisterEffect(e1)
18+
--During your Main Phase: You can banish this card from your GY, then target 1 Xyz Monster you control; attach 1 "Magistus" monster from your Deck to it.
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
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:SetCost(Cost.SelfBanish)
26+
e2:SetTarget(s.xyzmattg)
27+
e2:SetOperation(s.xyzmatop)
28+
c:RegisterEffect(e2)
29+
end
30+
s.listed_series={SET_MAGISTUS}
31+
function s.toextrafilter(c)
32+
return c:IsOriginalType(TYPE_EXTRA) and c:IsMonsterCard() and c:IsFaceup() and c:IsAbleToExtra()
33+
end
34+
function s.toextratg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
35+
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.toextrafilter(chkc) end
36+
if chk==0 then return Duel.IsExistingTarget(s.toextrafilter,tp,LOCATION_ONFIELD,0,1,nil) end
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
38+
local g=Duel.SelectTarget(tp,s.toextrafilter,tp,LOCATION_ONFIELD,0,1,1,nil)
39+
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,1,tp,0)
40+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
41+
end
42+
function s.spfilter(c,e,tp,typ)
43+
return c:IsSetCard(SET_MAGISTUS) and c:IsType(typ) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
44+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
45+
end
46+
function s.toextraop(e,tp,eg,ep,ev,re,r,rp)
47+
local tc=Duel.GetFirstTarget()
48+
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_EXTRA)
49+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,(tc:GetType()&TYPE_EXTRA))
50+
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
51+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
52+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,(tc:GetType()&TYPE_EXTRA))
53+
if #g>0 then
54+
Duel.BreakEffect()
55+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
56+
end
57+
end
58+
end
59+
function s.xyzfilter(c,tp)
60+
return c:IsXyzMonster() and c:IsFaceup() and Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_DECK,0,1,nil,tp,c)
61+
end
62+
function s.attachfilter(c,tp,xyzc)
63+
return c:IsSetCard(SET_MAGISTUS) and c:IsMonster() and c:IsCanBeXyzMaterial(xyzc,tp,REASON_EFFECT)
64+
end
65+
function s.xyzmattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
66+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc,tp) end
67+
if chk==0 then return Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
68+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
69+
Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
70+
end
71+
function s.xyzmatop(e,tp,eg,ep,ev,re,r,rp)
72+
local tc=Duel.GetFirstTarget()
73+
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
74+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
75+
local g=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_DECK,0,1,1,nil,tp,tc)
76+
if #g>0 then
77+
Duel.Overlay(tc,g)
78+
end
79+
end
80+
end

0 commit comments

Comments
 (0)