Skip to content

Commit 28386ff

Browse files
authored
Added new card scripts
1 parent 1bcda68 commit 28386ff

File tree

2 files changed

+211
-0
lines changed

2 files changed

+211
-0
lines changed

pre-release/c101303044.lua

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
--エクソシスター・カルマエル
2+
--Exosister Karmael
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 2 Level 4 "Exosister" monsters
8+
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_EXOSISTER),4,2)
9+
--Apply a "during the End Phase of this turn, Set 1 "Exosister" Spell/Trap from your Deck, GY, or banishment" effect
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
13+
e1:SetProperty(EFFECT_FLAG_DELAY)
14+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
15+
e1:SetCountLimit(1,id)
16+
e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end)
17+
e1:SetOperation(s.regop)
18+
c:RegisterEffect(e1)
19+
--Detach all materials from this card, and if you do, the activated effect becomes "Add 1 card from your opponent's GY to their hand"
20+
local e2=Effect.CreateEffect(c)
21+
e2:SetDescription(aux.Stringid(id,1))
22+
e2:SetType(EFFECT_TYPE_QUICK_O)
23+
e2:SetCode(EVENT_CHAINING)
24+
e2:SetRange(LOCATION_MZONE)
25+
e2:SetCountLimit(1,{id,1})
26+
e2:SetCondition(s.chcon)
27+
e2:SetTarget(s.chtg)
28+
e2:SetOperation(s.chop)
29+
c:RegisterEffect(e2)
30+
end
31+
s.listed_series={SET_EXOSISTER}
32+
function s.regop(e,tp,eg,ep,ev,re,r,rp)
33+
--During the End Phase of this turn, Set 1 "Exosister" Spell/Trap from your Deck, GY, or banishment
34+
local e1=Effect.CreateEffect(e:GetHandler())
35+
e1:SetDescription(aux.Stringid(id,2))
36+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
37+
e1:SetCode(EVENT_PHASE+PHASE_END)
38+
e1:SetCountLimit(1)
39+
e1:SetOperation(s.setop)
40+
e1:SetReset(RESET_PHASE|PHASE_END)
41+
Duel.RegisterEffect(e1,tp)
42+
end
43+
function s.setfilter(c)
44+
return c:IsSetCard(SET_EXOSISTER) and c:IsSpellTrap() and c:IsSSetable() and (c:IsFaceup() or c:IsLocation(LOCATION_DECK))
45+
end
46+
function s.setop(e,tp,eg,ep,ev,re,r,rp)
47+
Duel.Hint(HINT_CARD,0,id)
48+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
49+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil)
50+
if #g>0 then
51+
Duel.SSet(tp,g)
52+
end
53+
end
54+
function s.chcon(e,tp,eg,ep,ev,re,r,rp)
55+
local rc=re:GetHandler()
56+
return rp==1-tp and (re:IsMonsterEffect() or (rc:IsNormalSpellTrap() and re:IsHasType(EFFECT_TYPE_ACTIVATE)))
57+
end
58+
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
59+
if chk==0 then
60+
local c=e:GetHandler()
61+
local mat_ct=c:GetOverlayCount()
62+
return mat_ct>0 and c:CheckRemoveOverlayCard(tp,mat_ct,REASON_EFFECT)
63+
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil)
64+
end
65+
end
66+
function s.chop(e,tp,eg,ep,ev,re,r,rp)
67+
local c=e:GetHandler()
68+
local mg=c:GetOverlayGroup()
69+
if c:IsRelateToEffect(e) and #mg>0 and Duel.SendtoGrave(mg,REASON_EFFECT)>0 then
70+
local g=Group.CreateGroup()
71+
Duel.ChangeTargetCard(ev,g)
72+
Duel.ChangeChainOperation(ev,s.repop)
73+
end
74+
end
75+
function s.repop(e,tp,eg,ep,ev,re,r,rp)
76+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
77+
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_GRAVE,1,1,nil)
78+
if #g>0 then
79+
Duel.HintSelection(g)
80+
Duel.SendtoHand(g,nil,REASON_EFFECT)
81+
end
82+
end

pre-release/c101303066.lua

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
--エクソシスター・バト・マーテル
2+
--Exosister Bat Mater
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--When this card is activated: Add 2 "Exosister" monsters from your Deck to your hand, then discard 1 card
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCountLimit(1,id)
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.activate)
15+
c:RegisterEffect(e1)
16+
--Immediately after this effect resolves, Normal Summon 1 "Exosister" monster that is mentioned on that monster
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetDescription(aux.Stringid(id,1))
19+
e2:SetCategory(CATEGORY_SUMMON)
20+
e2:SetType(EFFECT_TYPE_IGNITION)
21+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
22+
e2:SetRange(LOCATION_SZONE)
23+
e2:SetCountLimit(1,{id,1})
24+
e2:SetTarget(s.nstg)
25+
e2:SetOperation(s.nsop)
26+
c:RegisterEffect(e2)
27+
--Make your opponent banish 1 of them
28+
local e3a=Effect.CreateEffect(c)
29+
e3a:SetDescription(aux.Stringid(id,2))
30+
e3a:SetCategory(CATEGORY_REMOVE)
31+
e3a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
32+
e3a:SetProperty(EFFECT_FLAG_DELAY)
33+
e3a:SetCode(EVENT_CUSTOM+id)
34+
e3a:SetRange(LOCATION_SZONE)
35+
e3a:SetCountLimit(1,{id,2})
36+
e3a:SetTarget(s.rmtg)
37+
e3a:SetOperation(s.rmop)
38+
c:RegisterEffect(e3a)
39+
local g=Group.CreateGroup()
40+
e3a:SetLabelObject(g)
41+
--Keep track of monsters sent to your opponent's GY
42+
local e3b=Effect.CreateEffect(c)
43+
e3b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
44+
e3b:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
45+
e3b:SetCode(EVENT_TO_GRAVE)
46+
e3b:SetRange(LOCATION_SZONE)
47+
e3b:SetLabelObject(e3a)
48+
e3b:SetOperation(s.regop)
49+
c:RegisterEffect(e3b)
50+
end
51+
s.listed_series={SET_EXOSISTER}
52+
function s.thfilter(c)
53+
return c:IsSetCard(SET_EXOSISTER) and c:IsMonster() and c:IsAbleToHand()
54+
end
55+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
56+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,2,nil) end
57+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
58+
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,tp,1)
59+
end
60+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
61+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
62+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,2,2,nil)
63+
if #g==2 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
64+
Duel.ConfirmCards(1-tp,g)
65+
Duel.ShuffleHand(tp)
66+
Duel.BreakEffect()
67+
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD,nil)
68+
end
69+
end
70+
function s.tgfilter(c,tp)
71+
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.nsfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,c)
72+
end
73+
function s.nsfilter(c,tc)
74+
return c:IsSetCard(SET_EXOSISTER) and c:IsSummonable(true,nil) and tc:ListsCode(c:GetCode())
75+
end
76+
function s.nstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
77+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc,tp) end
78+
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
79+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
80+
local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
81+
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_MZONE)
82+
end
83+
function s.nsop(e,tp,eg,ep,ev,re,r,rp)
84+
local tc=Duel.GetFirstTarget()
85+
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
86+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
87+
local sc=Duel.SelectMatchingCard(tp,s.nsfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,tc):GetFirst()
88+
if sc then
89+
Duel.Summon(tp,sc,true,nil)
90+
end
91+
end
92+
end
93+
function s.regfilter(c,opp)
94+
return c:IsMonster() and c:IsControler(opp)
95+
end
96+
function s.regop(e,tp,eg,ep,ev,re,r,rp)
97+
local tg=eg:Filter(s.regfilter,nil,1-tp)
98+
if #tg>0 then
99+
for tc in tg:Iter() do
100+
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
101+
end
102+
local g=e:GetLabelObject():GetLabelObject()
103+
if Duel.GetCurrentChain()==0 then g:Clear() end
104+
g:Merge(tg)
105+
g:Remove(function(c) return c:GetFlagEffect(id)==0 end,nil)
106+
e:GetLabelObject():SetLabelObject(g)
107+
Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,tp,tp,0)
108+
end
109+
end
110+
function s.rmfilter(c,opp)
111+
return c:IsControler(opp) and c:IsLocation(LOCATION_GRAVE) and c:IsAbleToRemove(opp)
112+
end
113+
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
114+
local g=e:GetLabelObject():Filter(s.rmfilter,nil,1-tp)
115+
if chk==0 then return #g>0 end
116+
Duel.SetTargetCard(g)
117+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,0)
118+
end
119+
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
120+
local g=Duel.GetTargetCards(e)
121+
if #g==0 then return end
122+
local opp=1-tp
123+
Duel.Hint(HINT_SELECTMSG,opp,HINTMSG_REMOVE)
124+
g=g:FilterSelect(opp,Card.IsAbleToRemove,1,1,nil,opp)
125+
if #g>0 then
126+
Duel.HintSelection(g)
127+
Duel.Remove(g,POS_FACEUP,REASON_EFFECT,PLAYER_NONE,opp)
128+
end
129+
end

0 commit comments

Comments
 (0)