Skip to content

Commit 3535eb4

Browse files
authored
Added new card scripts
1 parent d985788 commit 3535eb4

File tree

7 files changed

+638
-0
lines changed

7 files changed

+638
-0
lines changed

pre-release/c100447005.lua

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
--セイバー・コンビネーション
2+
--Saber Combination
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Activate
7+
local e0=Effect.CreateEffect(c)
8+
e0:SetType(EFFECT_TYPE_ACTIVATE)
9+
e0:SetCode(EVENT_FREE_CHAIN)
10+
c:RegisterEffect(e0)
11+
--While you have 10 or more "X-Saber" monsters in your field, GY, and/or banishment, "X-Saber" monsters you control gain ATK equal to their own original DEF
12+
local e1=Effect.CreateEffect(c)
13+
e1:SetType(EFFECT_TYPE_FIELD)
14+
e1:SetCode(EFFECT_UPDATE_ATTACK)
15+
e1:SetRange(LOCATION_SZONE)
16+
e1:SetTargetRange(LOCATION_MZONE,0)
17+
e1:SetCondition(s.atkcon)
18+
e1:SetTarget(function(e,c) return c:IsSetCard(SET_X_SABER) end)
19+
e1:SetValue(function(e,c) return c:GetBaseDefense() end)
20+
c:RegisterEffect(e1)
21+
--Special Summon 1 "X-Saber" monster from your hand or Deck
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,0))
24+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
25+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
26+
e2:SetProperty(EFFECT_FLAG_DELAY)
27+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
28+
e2:SetRange(LOCATION_SZONE)
29+
e2:SetCountLimit(1,{id,0})
30+
e2:SetCondition(s.handdeckspcon)
31+
e2:SetTarget(s.sptg(LOCATION_HAND|LOCATION_DECK))
32+
e2:SetOperation(s.spop(LOCATION_HAND|LOCATION_DECK))
33+
c:RegisterEffect(e2)
34+
--Special Summon 1 "X-Saber" monster from your hand
35+
local e3=Effect.CreateEffect(c)
36+
e3:SetDescription(aux.Stringid(id,1))
37+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
38+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
39+
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
40+
e3:SetRange(LOCATION_SZONE)
41+
e3:SetCountLimit(1,{id,1})
42+
e3:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end)
43+
e3:SetTarget(s.sptg(LOCATION_HAND))
44+
e3:SetOperation(s.spop(LOCATION_HAND))
45+
c:RegisterEffect(e3)
46+
end
47+
s.listed_series={SET_X_SABER}
48+
function s.atkfilter(c)
49+
return c:IsSetCard(SET_X_SABER) and c:IsMonster() and c:IsFaceup()
50+
end
51+
function s.atkcon(e)
52+
return Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE|LOCATION_GRAVE|LOCATION_REMOVED,0,10,nil)
53+
end
54+
function s.handdeckspconfilter(c,tp)
55+
return c:IsSummonPlayer(tp) and c:IsSetCard(SET_X_SABER) and c:IsSummonLocation(LOCATION_EXTRA) and c:IsFaceup()
56+
end
57+
function s.handdeckspcon(e,tp,eg,ep,ev,re,r,rp)
58+
return eg:IsExists(s.handdeckspconfilter,1,nil,tp)
59+
end
60+
function s.spfilter(c,e,tp)
61+
return c:IsSetCard(SET_X_SABER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
62+
end
63+
function s.sptg(location)
64+
return function(e,tp,eg,ep,ev,re,r,rp,chk)
65+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
66+
and Duel.IsExistingMatchingCard(s.spfilter,tp,location,0,1,nil,e,tp) end
67+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,location)
68+
end
69+
end
70+
function s.spop(location)
71+
return function(e,tp,eg,ep,ev,re,r,rp)
72+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
73+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
74+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,location,0,1,1,nil,e,tp)
75+
if #g>0 then
76+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
77+
end
78+
end
79+
end

pre-release/c100449001.lua

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
--フォーリンチーター
2+
--Fallin' Cheatah
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--This face-up card in the Monster Zone cannot be Tributed, nor used as material for a Fusion, Synchro, Xyz, or Link Summon
7+
local e1a=Effect.CreateEffect(c)
8+
e1a:SetType(EFFECT_TYPE_SINGLE)
9+
e1a:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
10+
e1a:SetCode(EFFECT_UNRELEASABLE_SUM)
11+
e1a:SetRange(LOCATION_MZONE)
12+
e1a:SetValue(1)
13+
c:RegisterEffect(e1a)
14+
local e1b=e1a:Clone()
15+
e1b:SetCode(EFFECT_UNRELEASABLE_NONSUM)
16+
c:RegisterEffect(e1b)
17+
local e1c=e1a:Clone()
18+
e1c:SetCode(EFFECT_CANNOT_BE_MATERIAL)
19+
e1c:SetValue(aux.cannotmatfilter(SUMMON_TYPE_FUSION,SUMMON_TYPE_SYNCHRO,SUMMON_TYPE_XYZ,SUMMON_TYPE_LINK))
20+
c:RegisterEffect(e1c)
21+
--Give control of this card to that monster's controller, also that monster cannot be Tributed nor used as material for a Fusion, Synchro, Xyz or Link Summon while this monster is face-up on the field
22+
local e2a=Effect.CreateEffect(c)
23+
e2a:SetDescription(aux.Stringid(id,0))
24+
e2a:SetCategory(CATEGORY_CONTROL)
25+
e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
26+
e2a:SetProperty(EFFECT_FLAG_CARD_TARGET,EFFECT_FLAG2_CHECK_SIMULTANEOUS)
27+
e2a:SetCode(EVENT_CUSTOM+id)
28+
e2a:SetRange(LOCATION_MZONE)
29+
e2a:SetTarget(s.ctrltg)
30+
e2a:SetOperation(s.ctrlop)
31+
e2a:SetLabelObject(Group.CreateGroup())
32+
c:RegisterEffect(e2a)
33+
--Keep track of monsters Special Summoned to the opponent's field
34+
local e2b=Effect.CreateEffect(c)
35+
e2b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
36+
e2b:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
37+
e2b:SetCode(EVENT_SPSUMMON_SUCCESS)
38+
e2b:SetRange(LOCATION_MZONE)
39+
e2b:SetLabelObject(e2a)
40+
e2b:SetOperation(s.regop)
41+
c:RegisterEffect(e2b)
42+
end
43+
function s.tgfilter(c,e,opp)
44+
return c:IsControler(opp) and c:IsLocation(LOCATION_MZONE) and (not e or c:IsCanBeEffectTarget(e))
45+
end
46+
function s.regop(e,tp,eg,ep,ev,re,r,rp)
47+
local tg=eg:Filter(s.tgfilter,nil,nil,1-tp)
48+
if #tg>0 then
49+
for tc in tg:Iter() do
50+
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
51+
end
52+
local g=e:GetLabelObject():GetLabelObject()
53+
if Duel.GetCurrentChain()==0 then g:Clear() end
54+
g:Merge(tg)
55+
g:Remove(function(c) return c:GetFlagEffect(id)==0 end,nil)
56+
e:GetLabelObject():SetLabelObject(g)
57+
Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,tp,tp,0)
58+
end
59+
end
60+
function s.ctrlfilter(c,tp)
61+
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0
62+
end
63+
function s.ctrltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
64+
local g=e:GetLabelObject():Filter(s.tgfilter,nil,e,1-tp):Match(s.ctrlfilter,nil,tp)
65+
if chkc then return g:IsContains(chkc) and s.tgfilter(chkc,e,1-tp) end
66+
local c=e:GetHandler()
67+
if chk==0 then return true end
68+
if #g>0 then
69+
local tc=nil
70+
if #g>1 then
71+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
72+
tc=g:Select(tp,1,1,nil):GetFirst()
73+
else
74+
tc=g:GetFirst()
75+
end
76+
Duel.SetTargetCard(tc)
77+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,c,1,tp,0)
78+
end
79+
end
80+
function s.ctrlop(e,tp,eg,ep,ev,re,r,rp)
81+
local c=e:GetHandler()
82+
if not c:IsRelateToEffect(e) then return end
83+
local tc=Duel.GetFirstTarget()
84+
if tc and tc:IsRelateToEffect(e) and Duel.GetControl(c,tc:GetControler()) and c:IsFaceup() then
85+
c:SetCardTarget(tc)
86+
local fid=c:GetFieldID()
87+
tc:RegisterFlagEffect(id+100,RESET_EVENT|(RESETS_STANDARD&~RESET_TURN_SET),EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(id,1))
88+
--That monster cannot be Tributed nor used as material for a Fusion, Synchro, Xyz or Link Summon while this monster is face-up on the field
89+
local e1a=Effect.CreateEffect(c)
90+
e1a:SetType(EFFECT_TYPE_FIELD)
91+
e1a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
92+
e1a:SetCode(EFFECT_UNRELEASABLE_SUM)
93+
e1a:SetRange(LOCATION_MZONE)
94+
e1a:SetTarget(function(e,c) return c:GetFlagEffectLabel(id+100)==fid end)
95+
e1a:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
96+
e1a:SetValue(1)
97+
e1a:SetReset(RESET_EVENT|RESETS_STANDARD)
98+
c:RegisterEffect(e1a)
99+
local e1b=e1a:Clone()
100+
e1b:SetCode(EFFECT_UNRELEASABLE_NONSUM)
101+
c:RegisterEffect(e1b)
102+
local e1c=e1a:Clone()
103+
e1c:SetCode(EFFECT_CANNOT_BE_MATERIAL)
104+
e1c:SetValue(aux.cannotmatfilter(SUMMON_TYPE_FUSION,SUMMON_TYPE_SYNCHRO,SUMMON_TYPE_XYZ,SUMMON_TYPE_LINK))
105+
c:RegisterEffect(e1c)
106+
end
107+
end

pre-release/c100449002.lua

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
--影装騎士 ブラック・ジャク
2+
--Black Jack the Shadow-Armored Knight
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Synchro Summon procedure: 1 Tuner + 1+ non-Tuner monsters
8+
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
9+
--Cannot be destroyed by battle
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_SINGLE)
12+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
13+
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetValue(1)
16+
c:RegisterEffect(e1)
17+
--Excavate cards from the top of your Deck until you excavate a monster, equip it to this card as an Equip Spell, also place the rest on the bottom of the Deck in any order
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,0))
20+
e2:SetCategory(CATEGORY_EQUIP)
21+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
22+
e2:SetCode(EVENT_MOVE)
23+
e2:SetRange(LOCATION_MZONE)
24+
e2:SetCondition(function(e,tp,eg) return eg:IsExists(function(c) return c:IsControler(1-tp) and c:IsLocation(LOCATION_STZONE) end,1,nil) end)
25+
e2:SetTarget(s.eqtg)
26+
e2:SetOperation(s.eqop)
27+
c:RegisterEffect(e2)
28+
aux.AddEREquipLimit(c,nil,function(ec,c,tp) return ec:IsControler(tp) and ec:IsMonster() end,Card.EquipByEffectAndLimitRegister,e2)
29+
--Gains ATK/DEF equal to the total Levels of the monsters equipped to this card x 300
30+
local e3a=Effect.CreateEffect(c)
31+
e3a:SetType(EFFECT_TYPE_SINGLE)
32+
e3a:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
33+
e3a:SetCode(EFFECT_UPDATE_ATTACK)
34+
e3a:SetRange(LOCATION_MZONE)
35+
e3a:SetValue(function(e,c) return c:GetEquipGroup():Match(Card.HasLevel,nil):GetSum(Card.GetLevel)*300 end)
36+
c:RegisterEffect(e3a)
37+
local e3b=e3a:Clone()
38+
e3b:SetCode(EFFECT_UPDATE_DEFENSE)
39+
c:RegisterEffect(e3b)
40+
--If the total Levels of the monsters equipped to this card is greater than 21, destroy this card
41+
local e4=Effect.CreateEffect(c)
42+
e4:SetType(EFFECT_TYPE_SINGLE)
43+
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
44+
e4:SetCode(EFFECT_SELF_DESTROY)
45+
e4:SetRange(LOCATION_MZONE)
46+
e4:SetCondition(function(e) return e:GetHandler():GetEquipGroup():Match(Card.HasLevel,nil):GetSum(Card.GetLevel)>21 end)
47+
c:RegisterEffect(e4)
48+
end
49+
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
50+
if chk==0 then return true end
51+
Duel.SetPossibleOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
52+
end
53+
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
54+
local deck_count=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
55+
if deck_count==0 then return end
56+
Duel.DisableShuffleCheck()
57+
local g=Duel.GetMatchingGroup(Card.IsMonster,tp,LOCATION_DECK,0,nil)
58+
if #g==0 then
59+
Duel.ConfirmDecktop(tp,deck_count)
60+
Duel.SortDeckbottom(tp,tp,deck_count)
61+
return
62+
end
63+
local c=e:GetHandler()
64+
local ec=g:GetMaxGroup(Card.GetSequence):GetFirst()
65+
local ec_seq=ec:GetSequence()
66+
Duel.ConfirmDecktop(tp,deck_count-ec_seq)
67+
local top_g=Duel.GetDecktopGroup(tp,deck_count-ec_seq)
68+
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE,0)>0
69+
and not ec:IsForbidden() and ec:CheckUniqueOnField(tp) then
70+
c:EquipByEffectAndLimitRegister(e,tp,ec,nil,true)
71+
else
72+
Duel.SendtoGrave(ec,REASON_RULE)
73+
end
74+
top_g:RemoveCard(ec)
75+
Duel.MoveToDeckBottom(top_g,tp)
76+
Duel.SortDeckbottom(tp,tp,#top_g)
77+
end

pre-release/c100449003.lua

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
--恐依のペアルックマ!!
2+
--Pair Bear Scare!!
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Your opponent can reveal 1 "Pair Bear Scare!!" in their hand or Deck, and if they do, each player gains 2000 LP, otherwise, you destroy 1 monster your opponent controls
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_DESTROY)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCountLimit(1,{id,0},EFFECT_COUNT_CODE_OATH)
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.activate)
15+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
16+
c:RegisterEffect(e1)
17+
--Add this card to your opponent's hand
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_TOHAND)
21+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
22+
e2:SetCode(EVENT_TO_GRAVE)
23+
e2:SetCountLimit(1,{id,1},EFFECT_COUNT_CODE_DUEL)
24+
e2:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end)
25+
e2:SetTarget(s.thtg)
26+
e2:SetOperation(s.thop)
27+
c:RegisterEffect(e2)
28+
end
29+
s.listed_names={id}
30+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
31+
if chk==0 then return true end
32+
Duel.SetPossibleOperationInfo(0,CATEGORY_RECOVER,nil,0,PLAYER_ALL,2000)
33+
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_MZONE)
34+
end
35+
function s.revealfilter(c)
36+
return c:IsCode(id) and not c:IsPublic()
37+
end
38+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
39+
local opp=1-tp
40+
if Duel.IsExistingMatchingCard(s.revealfilter,opp,LOCATION_HAND|LOCATION_DECK,0,1,nil)
41+
and Duel.SelectYesNo(opp,aux.Stringid(id,2)) then
42+
Duel.Hint(HINT_SELECTMSG,opp,HINTMSG_CONFIRM)
43+
local sc=Duel.SelectMatchingCard(opp,s.revealfilter,opp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil):GetFirst()
44+
Duel.ConfirmCards(tp,sc)
45+
if sc:IsLocation(LOCATION_HAND) then
46+
Duel.ShuffleHand(opp)
47+
else
48+
Duel.ShuffleDeck(opp)
49+
end
50+
Duel.Recover(tp,2000,REASON_EFFECT)
51+
Duel.Recover(opp,2000,REASON_EFFECT)
52+
else
53+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
54+
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
55+
if #g>0 then
56+
Duel.HintSelection(g)
57+
Duel.Destroy(g,REASON_EFFECT)
58+
end
59+
end
60+
end
61+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
62+
if chk==0 then return true end
63+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0)
64+
end
65+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
66+
local c=e:GetHandler()
67+
if c:IsRelateToEffect(e) then
68+
Duel.SendtoHand(c,1-tp,REASON_EFFECT)
69+
end
70+
end

0 commit comments

Comments
 (0)