Skip to content

Commit 4f3148f

Browse files
authored
Added new card scripts
1 parent 4b3af3e commit 4f3148f

28 files changed

+2481
-0
lines changed

pre-release/c100451001.lua

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
--王のしもべ-ブラック・マジシャン
2+
--Dark Magician, the Pharaoh's Servant
3+
--Scripted by Eerie Code
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Change name
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetType(EFFECT_TYPE_SINGLE)
9+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
10+
e1:SetCode(EFFECT_CHANGE_CODE)
11+
e1:SetRange(LOCATION_MZONE|LOCATION_GRAVE)
12+
e1:SetValue(CARD_DARK_MAGICIAN)
13+
c:RegisterEffect(e1)
14+
--special summon
15+
local e2=Effect.CreateEffect(c)
16+
e2:SetDescription(aux.Stringid(id,0))
17+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
18+
e2:SetType(EFFECT_TYPE_IGNITION)
19+
e2:SetRange(LOCATION_HAND)
20+
e2:SetCountLimit(1,id)
21+
e2:SetCost(Cost.Reveal(function(c) return c:IsSpell() end))
22+
e2:SetTarget(s.hsptg)
23+
e2:SetOperation(s.hspop)
24+
c:RegisterEffect(e2)
25+
--destroy
26+
local e3=Effect.CreateEffect(c)
27+
e3:SetDescription(aux.Stringid(id,1))
28+
e3:SetCategory(CATEGORY_DESTROY)
29+
e3:SetType(EFFECT_TYPE_QUICK_O)
30+
e3:SetCode(EVENT_FREE_CHAIN)
31+
e3:SetRange(LOCATION_MZONE)
32+
e3:SetCountLimit(1,id)
33+
e3:SetCost(Cost.Discard(function(c) return c:IsSpell() end))
34+
e3:SetTarget(s.destg)
35+
e3:SetOperation(s.desop)
36+
e3:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E|TIMING_SSET)
37+
c:RegisterEffect(e3)
38+
end
39+
s.listed_names={CARD_DARK_MAGICIAN}
40+
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
41+
local c=e:GetHandler()
42+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
43+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
44+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
45+
end
46+
function s.setfilter(c)
47+
return c:IsSpellTrap() and c:ListsCode(CARD_DARK_MAGICIAN) and c:IsSSetable()
48+
end
49+
function s.hspop(e,tp,eg,ep,ev,re,r,rp)
50+
local c=e:GetHandler()
51+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
52+
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK,0,nil)
53+
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
54+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
55+
local sg=g:Select(tp,1,1,nil)
56+
if #sg>0 then
57+
Duel.BreakEffect()
58+
Duel.SSet(tp,sg)
59+
end
60+
end
61+
end
62+
end
63+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
64+
local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,nil)
65+
if chk==0 then return #g>0 end
66+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
67+
end
68+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
69+
local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,0,LOCATION_ONFIELD,nil)
70+
if #g>0 then
71+
Duel.Destroy(g,REASON_EFFECT)
72+
end
73+
end

pre-release/c100451004.lua

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
--F・HERO シャイニング・フレア・ウィングマン
2+
--Favorite HERO Shining Flare Wingman
3+
--Scripted by Eerie Code
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 1 Fusion Monster + 1 face-up monster on the field
8+
Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsType,TYPE_FUSION),s.matfilter)
9+
--to deck
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_TODECK|CATEGORY_DRAW|CATEGORY_ATKCHANGE)
13+
e1:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_O)
14+
e1:SetProperty(EFFECT_FLAG_DELAY|EFFECT_FLAG_PLAYER_TARGET)
15+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
16+
e1:SetCountLimit(1,id)
17+
e1:SetCondition(function(e) return e:GetHandler():IsSummonLocation(LOCATION_EXTRA) end)
18+
e1:SetTarget(s.target)
19+
e1:SetOperation(s.operation)
20+
c:RegisterEffect(e1)
21+
--Inflict damage
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,1))
24+
e2:SetCategory(CATEGORY_DAMAGE)
25+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
26+
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
27+
e2:SetCode(EVENT_BATTLE_DESTROYING)
28+
e2:SetCondition(aux.bdcon)
29+
e2:SetTarget(s.damtg)
30+
e2:SetOperation(s.damop)
31+
c:RegisterEffect(e2)
32+
end
33+
s.listed_series={SET_ELEMENTAL_HERO}
34+
function s.matfilter(c)
35+
return c:IsFaceup() and c:IsOnField()
36+
end
37+
function s.tdfilter(c)
38+
return c:IsMonster() and c:IsAbleToDeck()
39+
end
40+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
41+
if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE,0,5,nil)
42+
and Duel.IsPlayerCanDraw(tp,2) end
43+
Duel.SetTargetPlayer(tp)
44+
Duel.SetTargetParam(2)
45+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,5,tp,LOCATION_GRAVE)
46+
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
47+
end
48+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
49+
local c=e:GetHandler()
50+
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
51+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
52+
local g=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_GRAVE,0,5,5,nil)
53+
if #g~=5 then return end
54+
Duel.HintSelection(g)
55+
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==5 then
56+
if Duel.GetOperatedGroup():IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
57+
Duel.BreakEffect()
58+
if Duel.Draw(p,d,REASON_EFFECT)==2 and c:IsRelateToEffect(e) and c:IsFaceup() then
59+
c:UpdateAttack(1000)
60+
end
61+
end
62+
end
63+
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
64+
if chk==0 then return true end
65+
local dam=e:GetHandler():GetBattleTarget():GetBaseAttack()
66+
if dam<0 then dam=0 end
67+
Duel.SetTargetPlayer(1-tp)
68+
Duel.SetTargetParam(dam)
69+
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
70+
end
71+
function s.damop(e,tp,eg,ep,ev,re,r,rp)
72+
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
73+
Duel.Damage(p,d,REASON_EFFECT)
74+
end

pre-release/c100451007.lua

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
--スターダスト・ドラゴン-ヴィクテム・サンクチュアリ
2+
--Stardust Dragon - Victim Sanctuary
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+
--When your opponent activates a card or effect in response to your card or effect activation (Quick Effect): You can Tribute this card; negate that opponent's effect, and if you do, destroy that card
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
13+
e1:SetType(EFFECT_TYPE_QUICK_O)
14+
e1:SetCode(EVENT_CHAINING)
15+
e1:SetRange(LOCATION_MZONE)
16+
e1:SetCountLimit(1,{id,0})
17+
e1:SetCondition(s.discon)
18+
e1:SetCost(Cost.AND(aux.StardustCost,Cost.HardOncePerChain(id)))
19+
e1:SetTarget(s.distg)
20+
e1:SetOperation(s.disop)
21+
c:RegisterEffect(e1)
22+
--If a monster(s) in your possession was Tributed this turn (Quick Effect): You can banish this card from your GY; Special Summon 1 "Stardust" Synchro Monster from your Extra Deck
23+
local e2=Effect.CreateEffect(c)
24+
e2:SetDescription(aux.Stringid(id,1))
25+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
26+
e2:SetType(EFFECT_TYPE_QUICK_O)
27+
e2:SetCode(EVENT_FREE_CHAIN)
28+
e2:SetRange(LOCATION_GRAVE)
29+
e2:SetCountLimit(1,{id,1})
30+
e2:SetCondition(function(e,tp) return Duel.HasFlagEffect(tp,id+100) end)
31+
e2:SetCost(Cost.AND(Cost.SelfBanish,Cost.HardOncePerChain(id)))
32+
e2:SetTarget(s.sptg)
33+
e2:SetOperation(s.spop)
34+
e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
35+
c:RegisterEffect(e2)
36+
--Keep track of monsters being Tributed
37+
aux.GlobalCheck(s,function()
38+
local ge1=Effect.CreateEffect(c)
39+
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
40+
ge1:SetCode(EVENT_RELEASE)
41+
ge1:SetOperation(s.checkop)
42+
Duel.RegisterEffect(ge1,0)
43+
end)
44+
end
45+
s.listed_series={SET_STARDUST}
46+
function s.checkfilter(c)
47+
return c:IsPreviousLocation(LOCATION_MZONE) or (c:IsMonster() and not c:IsPreviousLocation(LOCATION_ONFIELD))
48+
end
49+
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
50+
local g=eg:Filter(s.checkfilter,nil)
51+
if g:IsExists(Card.IsPreviousControler,1,nil,0) then
52+
Duel.RegisterFlagEffect(0,id+100,RESET_PHASE|PHASE_END,0,1)
53+
end
54+
if g:IsExists(Card.IsPreviousControler,1,nil,1) then
55+
Duel.RegisterFlagEffect(1,id+100,RESET_PHASE|PHASE_END,0,1)
56+
end
57+
end
58+
function s.discon(e,tp,eg,ep,ev,re,r,rp)
59+
local ch=Duel.GetCurrentChain()-1
60+
return ch>0 and ep==1-tp and Duel.GetChainInfo(ch,CHAININFO_TRIGGERING_CONTROLER)==tp and Duel.IsChainDisablable(ev)
61+
end
62+
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
63+
if chk==0 then return true end
64+
local rc=re:GetHandler()
65+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,tp,0)
66+
if rc:IsDestructable() and rc:IsRelateToEffect(re) then
67+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0)
68+
end
69+
end
70+
function s.disop(e,tp,eg,ep,ev,re,r,rp)
71+
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
72+
Duel.Destroy(eg,REASON_EFFECT)
73+
end
74+
end
75+
function s.spfilter(c,e,tp)
76+
return c:IsSetCard(SET_STARDUST) and c:IsSynchroMonster() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
77+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
78+
end
79+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
80+
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
81+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
82+
end
83+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
84+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
85+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
86+
if #g>0 then
87+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
88+
end
89+
end

pre-release/c100451010.lua

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
--No.39 光の使者 希望皇ホープ
2+
--Number 39: Utopia the Envoy of Light
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 monsters
8+
Xyz.AddProcedure(c,nil,4,2)
9+
--Cannot be destroyed by battle, except with a "Number" monster
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_SINGLE)
12+
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
13+
e1:SetValue(aux.NOT(aux.TargetBoolFunction(Card.IsSetCard,SET_NUMBER)))
14+
c:RegisterEffect(e1)
15+
--(Quick Effect): You can detach 1 material from this card, then target 1 monster you control; the first time it would be destroyed by battle or card effect this turn, it is not destroyed
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,0))
18+
e2:SetType(EFFECT_TYPE_QUICK_O)
19+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
20+
e2:SetCode(EVENT_FREE_CHAIN)
21+
e2:SetRange(LOCATION_MZONE)
22+
e2:SetCost(Cost.DetachFromSelf(1))
23+
e2:SetTarget(s.efftg)
24+
e2:SetOperation(s.effop)
25+
c:RegisterEffect(e2)
26+
--When the second attack of this turn is declared: You can make this card gain 2500 ATK, and if you do, it gains this effect
27+
local e3=Effect.CreateEffect(c)
28+
e3:SetDescription(aux.Stringid(id,1))
29+
e3:SetCategory(CATEGORY_ATKCHANGE)
30+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
31+
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
32+
e3:SetRange(LOCATION_MZONE)
33+
e3:SetCondition(function() return Duel.GetFlagEffect(0,id)==1 end)
34+
e3:SetOperation(s.atkop)
35+
c:RegisterEffect(e3)
36+
--Keep track of attacks being declared
37+
aux.GlobalCheck(s,function()
38+
local ge1=Effect.CreateEffect(c)
39+
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
40+
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
41+
ge1:SetOperation(function() Duel.RegisterFlagEffect(0,id,RESET_PHASE|PHASE_END,0,1) end)
42+
Duel.RegisterEffect(ge1,0)
43+
end)
44+
end
45+
s.listed_series={SET_NUMBER}
46+
s.xyz_number=39
47+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
48+
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) end
49+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO)
50+
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
51+
end
52+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
53+
local tc=Duel.GetFirstTarget()
54+
if tc:IsRelateToEffect(e) then
55+
--The first time it would be destroyed by battle or card effect this turn, it is not destroyed
56+
local e1=Effect.CreateEffect(e:GetHandler())
57+
e1:SetDescription(3001)
58+
e1:SetType(EFFECT_TYPE_SINGLE)
59+
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_SET_AVAILABLE)
60+
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
61+
e1:SetCountLimit(1)
62+
e1:SetValue(s.indesval)
63+
e1:SetReset(RESETS_STANDARD_PHASE_END)
64+
tc:RegisterEffect(e1)
65+
end
66+
end
67+
function s.indesval(e,re,r,rp)
68+
if r&(REASON_BATTLE|REASON_EFFECT)>0 then
69+
e:Reset()
70+
return true
71+
end
72+
return false
73+
end
74+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
75+
local c=e:GetHandler()
76+
if c:IsRelateToEffect(e) and c:IsFaceup() then
77+
--This card gains 2500 ATK
78+
c:UpdateAttack(2500)
79+
--When this card destroys a monster by battle and sends it to the GY: You can Special Summon it to your field
80+
local e1=Effect.CreateEffect(c)
81+
e1:SetDescription(aux.Stringid(id,2))
82+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
83+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
84+
e1:SetCode(EVENT_BATTLE_DESTROYING)
85+
e1:SetCondition(aux.bdgcon)
86+
e1:SetTarget(s.sptg)
87+
e1:SetOperation(s.spop)
88+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
89+
c:RegisterEffect(e1)
90+
end
91+
end
92+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
93+
local bc=e:GetHandler():GetBattleTarget()
94+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
95+
and bc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
96+
Duel.SetTargetCard(bc)
97+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,bc,1,tp,0)
98+
end
99+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
100+
local tc=Duel.GetFirstTarget()
101+
if tc:IsRelateToEffect(e) then
102+
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
103+
end
104+
end

0 commit comments

Comments
 (0)