Skip to content

Commit f717011

Browse files
authored
Added new card scripts
1 parent 1bc1901 commit f717011

File tree

10 files changed

+747
-0
lines changed

10 files changed

+747
-0
lines changed

pre-release/c100410001.lua

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
--Japanese name
2+
--The Man with the Mark
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Take 1 "Temple of the Kings", or 1 Spell/Trap that mentions it, from your Deck and either add it to your hand or send it to the GY
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY)
12+
e1:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.thtgtg)
15+
e1:SetOperation(s.thtgop)
16+
c:RegisterEffect(e1)
17+
local e2=e1:Clone()
18+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
19+
c:RegisterEffect(e2)
20+
--While you control "Temple of the Kings", this card and "Apophis" monsters you control cannot be destroyed by battle or card effects
21+
--"Temple of the Kings" you control cannot be destroyed by card effects
22+
local e3=Effect.CreateEffect(c)
23+
e3:SetType(EFFECT_TYPE_FIELD)
24+
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
25+
e3:SetRange(LOCATION_MZONE)
26+
e3:SetTargetRange(LOCATION_MZONE,0)
27+
e3:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_TEMPLE_OF_THE_KINGS),e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) end)
28+
e3:SetTarget(function(e,c) return c==e:GetHandler() or c:IsSetCard(SET_APOPHIS) end)
29+
e3:SetValue(1)
30+
c:RegisterEffect(e3)
31+
local e4=e3:Clone()
32+
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
33+
e4:SetTargetRange(LOCATION_ONFIELD,0)
34+
e4:SetTarget(function(e,c) return c==e:GetHandler() or (c:IsSetCard(SET_APOPHIS) and c:IsMonster()) or c:IsCode(CARD_TEMPLE_OF_THE_KINGS) end)
35+
c:RegisterEffect(e4)
36+
end
37+
s.listed_names={CARD_TEMPLE_OF_THE_KINGS}
38+
s.listed_series={SET_APOPHIS}
39+
function s.thtgfilter(c)
40+
return (c:IsCode(CARD_TEMPLE_OF_THE_KINGS) or (c:IsSpellTrap() and c:ListsCode(CARD_TEMPLE_OF_THE_KINGS))) and (c:IsAbleToHand() or c:IsAbleToGrave())
41+
end
42+
function s.thtgtg(e,tp,eg,ep,ev,re,r,rp,chk)
43+
if chk==0 then return Duel.IsExistingMatchingCard(s.thtgfilter,tp,LOCATION_DECK,0,1,nil) end
44+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
45+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
46+
end
47+
function s.thtgop(e,tp,eg,ep,ev,re,r,rp)
48+
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
49+
local g=Duel.SelectMatchingCard(tp,s.thtgfilter,tp,LOCATION_DECK,0,1,1,nil)
50+
if #g>0 then
51+
aux.ToHandOrElse(g,tp)
52+
end
53+
end

pre-release/c100410002.lua

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
--Japanese name
2+
--Merciless Scorpion of Serket
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Must first be Special Summoned (from your hand) by banishing 1 Level 10 or higher monster from your hand or Deck, while you control "Temple of the Kings"
8+
local e0=Effect.CreateEffect(c)
9+
e0:SetDescription(aux.Stringid(id,0))
10+
e0:SetType(EFFECT_TYPE_FIELD)
11+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
12+
e0:SetCode(EFFECT_SPSUMMON_PROC)
13+
e0:SetRange(LOCATION_HAND)
14+
e0:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
15+
e0:SetCondition(s.spcon)
16+
e0:SetTarget(s.sptg)
17+
e0:SetOperation(s.spop)
18+
c:RegisterEffect(e0)
19+
--Add 1 "Temple of the Kings", or 1 Spell that mentions it, from your Deck to your hand
20+
local e1=Effect.CreateEffect(c)
21+
e1:SetDescription(aux.Stringid(id,1))
22+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
23+
e1:SetType(EFFECT_TYPE_IGNITION)
24+
e1:SetRange(LOCATION_MZONE)
25+
e1:SetCountLimit(1)
26+
e1:SetTarget(s.thtg)
27+
e1:SetOperation(s.thop)
28+
c:RegisterEffect(e1)
29+
--Destroy an opponent's monster that this card is battling, and if you do, this card gains ATK equal to half the destroyed monster's original ATK
30+
local e2=Effect.CreateEffect(c)
31+
e2:SetDescription(aux.Stringid(id,2))
32+
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
33+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
34+
e2:SetCode(EVENT_BATTLE_START)
35+
e2:SetTarget(s.destg)
36+
e2:SetOperation(s.desop)
37+
c:RegisterEffect(e2)
38+
end
39+
s.listed_names={CARD_TEMPLE_OF_THE_KINGS}
40+
function s.spcostfilter(c,tp)
41+
return c:IsLevelAbove(10) and c:IsAbleToRemoveAsCost()
42+
end
43+
function s.spcon(e,c)
44+
if not c then return true end
45+
local tp=c:GetControler()
46+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
47+
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_TEMPLE_OF_THE_KINGS),tp,LOCATION_ONFIELD,0,1,nil)
48+
and Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,c)
49+
end
50+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
51+
local rg=Duel.GetMatchingGroup(s.spcostfilter,tp,LOCATION_HAND|LOCATION_DECK,0,c)
52+
local g=aux.SelectUnselectGroup(rg,e,tp,1,1,nil,1,tp,HINTMSG_REMOVE,nil,nil,true)
53+
if #g>0 then
54+
g:KeepAlive()
55+
e:SetLabelObject(g)
56+
return true
57+
end
58+
return false
59+
end
60+
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
61+
local g=e:GetLabelObject()
62+
if not g then return end
63+
Duel.Remove(g,POS_FACEUP,REASON_COST)
64+
g:DeleteGroup()
65+
end
66+
function s.thfilter(c)
67+
return (c:IsCode(CARD_TEMPLE_OF_THE_KINGS) or (c:IsSpell() and c:ListsCode(CARD_TEMPLE_OF_THE_KINGS))) and c:IsAbleToHand()
68+
end
69+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
70+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
71+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
72+
end
73+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
74+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
75+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
76+
if #g>0 then
77+
Duel.SendtoHand(g,nil,REASON_EFFECT)
78+
Duel.ConfirmCards(1-tp,g)
79+
end
80+
end
81+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
82+
local bc=e:GetHandler():GetBattleTarget()
83+
if chk==0 then return bc and bc:IsControler(1-tp) end
84+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,tp,0)
85+
end
86+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
87+
local c=e:GetHandler()
88+
local bc=c:GetBattleTarget()
89+
if not (bc and bc:IsRelateToBattle() and bc:IsControler(1-tp)) then return end
90+
local atk=bc:GetBaseAttack()/2
91+
if Duel.Destroy(bc,REASON_EFFECT)>0 and atk>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
92+
--This card gains ATK equal to half the destroyed monster's original ATK
93+
c:UpdateAttack(atk)
94+
end
95+
end

pre-release/c100410003.lua

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
--Japanese name
2+
--Anubis the Last Judge
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Must first be Special Summoned (from your hand or GY) while you have 3 or more cards in your GY with different names that are "Temple of the Kings" and/or Traps, by placing 2 of them on the bottom of the Deck in any order
8+
local e0=Effect.CreateEffect(c)
9+
e0:SetDescription(aux.Stringid(id,0))
10+
e0:SetType(EFFECT_TYPE_FIELD)
11+
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
12+
e0:SetCode(EFFECT_SPSUMMON_PROC)
13+
e0:SetRange(LOCATION_HAND|LOCATION_GRAVE)
14+
e0:SetCondition(s.spcon)
15+
e0:SetTarget(s.sptg)
16+
e0:SetOperation(s.spop)
17+
c:RegisterEffect(e0)
18+
--Add 1 "The Man with the Mark" from your Deck to your hand
19+
local e1=Effect.CreateEffect(c)
20+
e1:SetDescription(aux.Stringid(id,1))
21+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
22+
e1:SetType(EFFECT_TYPE_IGNITION)
23+
e1:SetRange(LOCATION_HAND)
24+
e1:SetCountLimit(1,id)
25+
e1:SetCost(Cost.SelfToGrave)
26+
e1:SetTarget(s.thtg)
27+
e1:SetOperation(s.thop)
28+
c:RegisterEffect(e1)
29+
--Destroy 1 card your opponent controls
30+
local e2=Effect.CreateEffect(c)
31+
e2:SetDescription(aux.Stringid(id,2))
32+
e2:SetCategory(CATEGORY_DESTROY)
33+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
34+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
35+
e2:SetCode(EVENT_DESTROYED)
36+
e2:SetRange(LOCATION_MZONE)
37+
e2:SetCountLimit(1,{id,1})
38+
e2:SetCondition(s.descon)
39+
e2:SetTarget(s.destg)
40+
e2:SetOperation(s.desop)
41+
c:RegisterEffect(e2)
42+
end
43+
s.listed_names={CARD_TEMPLE_OF_THE_KINGS,100410001} --"The Man with the Mark"
44+
function s.tdfilter(c)
45+
return c:IsCode(CARD_TEMPLE_OF_THE_KINGS) or c:IsTrap()
46+
end
47+
function s.spcon(e,c)
48+
if c==nil then return true end
49+
local tp=e:GetHandlerPlayer()
50+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
51+
local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE,0,nil)
52+
local rg=g:Filter(Card.IsAbleToDeckAsCost,c)
53+
return g:GetClassCount(Card.GetCode)>=3 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.dncheck,0)
54+
end
55+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
56+
local rg=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE,0,c):Match(Card.IsAbleToDeckAsCost,nil)
57+
local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.dncheck,1,tp,HINTMSG_TODECK,nil,nil,true)
58+
if #g>0 then
59+
g:KeepAlive()
60+
e:SetLabelObject(g)
61+
return true
62+
end
63+
return false
64+
end
65+
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
66+
local g=e:GetLabelObject()
67+
if not g then return end
68+
Duel.HintSelection(g)
69+
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_COST)
70+
g:DeleteGroup()
71+
Duel.SortDeckbottom(tp,tp,2)
72+
end
73+
function s.thfilter(c)
74+
return c:IsCode(100410001) and c:IsAbleToHand()
75+
end
76+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
77+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
78+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
79+
end
80+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
81+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
82+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
83+
if #g>0 then
84+
Duel.SendtoHand(g,nil,REASON_EFFECT)
85+
Duel.ConfirmCards(1-tp,g)
86+
end
87+
end
88+
function s.desconfilter(c,tp)
89+
return c:IsPreviousTypeOnField(TYPE_SPELL|TYPE_TRAP) and c:IsPreviousLocation(LOCATION_ONFIELD)
90+
and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT)
91+
end
92+
function s.descon(e,tp,eg,ep,ev,re,r,rp)
93+
return eg:IsExists(s.desconfilter,1,nil,tp)
94+
end
95+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
96+
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
97+
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
98+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
99+
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
100+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
101+
end
102+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
103+
local tc=Duel.GetFirstTarget()
104+
if tc:IsRelateToEffect(e) then
105+
Duel.Destroy(tc,REASON_EFFECT)
106+
end
107+
end

pre-release/c100410004.lua

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
--Japanese name
2+
--Divine Serpent Apophis
3+
--Scripted by Eerie Code
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 2 monsters that mention "Temple of the Kings"
8+
Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunction(Card.ListsCode,CARD_TEMPLE_OF_THE_KINGS),2)
9+
c:AddMustBeFusionSummoned()
10+
--Must be either Fusion Summoned, or Special Summoned by Tributing 2 "Apophis" monsters
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_EXTRA)
17+
e0:SetCondition(s.spcon)
18+
e0:SetTarget(s.sptg)
19+
e0:SetOperation(s.spop)
20+
c:RegisterEffect(e0)
21+
--Set up to 3 "Apophis" Traps with different names from your GY
22+
local e1=Effect.CreateEffect(c)
23+
e1:SetDescription(aux.Stringid(id,1))
24+
e1:SetType(EFFECT_TYPE_IGNITION)
25+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
26+
e1:SetRange(LOCATION_MZONE)
27+
e1:SetCountLimit(1)
28+
e1:SetTarget(s.settg)
29+
e1:SetOperation(s.setop)
30+
c:RegisterEffect(e1)
31+
--Destroy 1 card your opponent controls
32+
local e2=Effect.CreateEffect(c)
33+
e2:SetDescription(aux.Stringid(id,2))
34+
e2:SetCategory(CATEGORY_DESTROY)
35+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
36+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
37+
e2:SetCode(EVENT_CHAINING)
38+
e2:SetRange(LOCATION_MZONE)
39+
e2:SetCountLimit(1)
40+
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re:IsTrapEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE) end)
41+
e2:SetTarget(s.destg)
42+
e2:SetOperation(s.desop)
43+
c:RegisterEffect(e2)
44+
end
45+
s.listed_names={CARD_TEMPLE_OF_THE_KINGS}
46+
s.listed_series={SET_APOPHIS}
47+
function s.spcheck(sg,e,tp)
48+
return Duel.GetLocationCountFromEx(tp,tp,sg,e:GetHandler())>0
49+
end
50+
function s.spcon(e,c)
51+
if c==nil then return true end
52+
local tp=c:GetControler()
53+
local rg=Duel.GetReleaseGroup(tp):Filter(Card.IsSetCard,nil,SET_APOPHIS)
54+
return aux.SelectUnselectGroup(rg,e,tp,2,2,s.spcheck,0)
55+
end
56+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
57+
local rg=Duel.GetReleaseGroup(tp):Filter(Card.IsSetCard,nil,SET_APOPHIS)
58+
local g=aux.SelectUnselectGroup(rg,e,tp,2,2,s.spcheck,1,tp,HINTMSG_RELEASE,nil,nil,true)
59+
if #g>0 then
60+
g:KeepAlive()
61+
e:SetLabelObject(g)
62+
return true
63+
end
64+
return false
65+
end
66+
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
67+
local g=e:GetLabelObject()
68+
if not g then return end
69+
Duel.Release(g,REASON_COST)
70+
g:DeleteGroup()
71+
end
72+
function s.setfilter(c,e)
73+
return c:IsSetCard(SET_APOPHIS) and c:IsTrap() and c:IsSSetable() and c:IsCanBeEffectTarget(e)
74+
end
75+
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
76+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.setfilter(chkc,e) end
77+
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_GRAVE,0,nil,e)
78+
if chk==0 then return #g>0 end
79+
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
80+
local tg=aux.SelectUnselectGroup(g,e,tp,1,math.min(ft,3),aux.dncheck,1,tp,HINTMSG_SET)
81+
Duel.SetTargetCard(tg)
82+
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,tg,#tg,tp,0)
83+
end
84+
function s.setop(e,tp,eg,ep,ev,re,r,rp)
85+
local g=Duel.GetTargetCards(e)
86+
if #g>0 then
87+
Duel.SSet(tp,g)
88+
end
89+
end
90+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
91+
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
92+
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
93+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
94+
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
95+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
96+
end
97+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
98+
local tc=Duel.GetFirstTarget()
99+
if tc:IsRelateToEffect(e) then
100+
Duel.Destroy(tc,REASON_EFFECT)
101+
end
102+
end

0 commit comments

Comments
 (0)