Skip to content

Commit 5349fbf

Browse files
authored
Added new card scripts
1 parent 2760359 commit 5349fbf

6 files changed

Lines changed: 463 additions & 0 deletions

File tree

pre-release/c101301081.lua

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--Japanese name
2+
--Buio the Dawn's Light
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Monsters in your leftmost or rightmost Main Monster Zones cannot be destroyed by card effects
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetType(EFFECT_TYPE_FIELD)
9+
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
10+
e1:SetRange(LOCATION_MZONE)
11+
e1:SetTargetRange(LOCATION_MZONE,0)
12+
e1:SetTarget(function(e,c) return c:IsSequence(0,4) or (Duel.IsDuelType(DUEL_3_COLUMNS_FIELD) and c:IsSequence(1,3)) end)
13+
e1:SetValue(1)
14+
c:RegisterEffect(e1)
15+
--Negate the effects of 1 Fiend Effect Monster you control, and if you do, Special Summon this card
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,0))
18+
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_SPECIAL_SUMMON)
19+
e2:SetType(EFFECT_TYPE_IGNITION)
20+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
21+
e2:SetRange(LOCATION_HAND)
22+
e2:SetCountLimit(1,id)
23+
e2:SetTarget(s.sptg)
24+
e2:SetOperation(s.spop)
25+
c:RegisterEffect(e2)
26+
--Add 1 "Mutiny in the Sky" from your Deck to your hand
27+
local e3=Effect.CreateEffect(c)
28+
e3:SetDescription(aux.Stringid(id,1))
29+
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
30+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
31+
e3:SetProperty(EFFECT_FLAG_DELAY)
32+
e3:SetCode(EVENT_TO_GRAVE)
33+
e3:SetCountLimit(1,{id,1})
34+
e3:SetTarget(s.thtg)
35+
e3:SetOperation(s.thop)
36+
c:RegisterEffect(e3)
37+
end
38+
s.listed_names={101301083} --"Mutiny in the Sky"
39+
function s.disfilter(c)
40+
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_EFFECT) and c:IsNegatableMonster()
41+
end
42+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
43+
local c=e:GetHandler()
44+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.disfilter(chkc) end
45+
if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,LOCATION_MZONE,0,1,nil)
46+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
47+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
48+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
49+
local g=Duel.SelectTarget(tp,s.disfilter,tp,LOCATION_MZONE,0,1,1,nil)
50+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,tp,0)
51+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
52+
end
53+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
54+
local c=e:GetHandler()
55+
local tc=Duel.GetFirstTarget()
56+
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsCanBeDisabledByEffect(e) then
57+
--Negate its effects
58+
tc:NegateEffects(c)
59+
if c:IsRelateToEffect(e) then
60+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
61+
end
62+
end
63+
end
64+
function s.thfilter(c)
65+
return c:IsCode(101301083) and c:IsAbleToHand()
66+
end
67+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
68+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
69+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
70+
end
71+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
72+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
73+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
74+
if #g>0 then
75+
Duel.SendtoHand(g,nil,REASON_EFFECT)
76+
Duel.ConfirmCards(1-tp,g)
77+
end
78+
end

pre-release/c101301082.lua

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
--Japanese name
2+
--Luce the Dusk's Dark
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 3 Fiend and/or Fairy monsters in your GY
8+
Fusion.AddProcMixN(c,true,true,s.fusionmatfilter,3)
9+
--Monsters in your leftmost or rightmost Main Monster Zones cannot be destroyed by card effects
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_FIELD)
12+
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
13+
e1:SetRange(LOCATION_MZONE)
14+
e1:SetTargetRange(LOCATION_MZONE,0)
15+
e1:SetTarget(function(e,c) return c:IsSequence(0,4) or (Duel.IsDuelType(DUEL_3_COLUMNS_FIELD) and c:IsSequence(1,3)) end)
16+
e1:SetValue(1)
17+
c:RegisterEffect(e1)
18+
--Send 1 Fiend or Fairy monster from your Deck to the GY, and if you do, destroy 1 card your opponent controls
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,0))
21+
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DESTROY)
22+
e2:SetType(EFFECT_TYPE_IGNITION)
23+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
24+
e2:SetRange(LOCATION_MZONE)
25+
e2:SetCountLimit(1,id)
26+
e2:SetTarget(s.tgdestg)
27+
e2:SetOperation(s.tgdesop)
28+
c:RegisterEffect(e2)
29+
--Destroy 1 card on the field
30+
local e3=Effect.CreateEffect(c)
31+
e3:SetDescription(aux.Stringid(id,1))
32+
e3:SetCategory(CATEGORY_DESTROY)
33+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
34+
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
35+
e3:SetCode(EVENT_DESTROYED)
36+
e3:SetRange(LOCATION_MZONE)
37+
e3:SetCountLimit(1,{id,1})
38+
e3:SetCondition(s.descon)
39+
e3:SetTarget(s.destg)
40+
e3:SetOperation(s.desop)
41+
c:RegisterEffect(e3)
42+
end
43+
function s.fusionmatfilter(c,fc,sumtype,tp)
44+
return c:IsRace(RACE_FIEND|RACE_FAIRY,fc,sumtype,tp) and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
45+
end
46+
function s.tgfilter(c)
47+
return c:IsRace(RACE_FIEND|RACE_FAIRY) and c:IsAbleToGrave()
48+
end
49+
function s.tgdestg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
50+
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
51+
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil)
52+
and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
53+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
54+
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
55+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
56+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
57+
end
58+
function s.tgdesop(e,tp,eg,ep,ev,re,r,rp)
59+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
60+
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
61+
if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT) and g:GetFirst():IsLocation(LOCATION_GRAVE) then
62+
local tc=Duel.GetFirstTarget()
63+
if tc:IsRelateToEffect(e) then
64+
Duel.Destroy(tc,REASON_EFFECT)
65+
end
66+
end
67+
end
68+
function s.desconfilter(c,tp)
69+
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT)
70+
end
71+
function s.descon(e,tp,eg,ep,ev,re,r,rp)
72+
return eg:IsExists(s.desconfilter,1,nil,tp)
73+
end
74+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
75+
if chkc then return chkc:IsOnField() end
76+
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
77+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
78+
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
79+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
80+
end
81+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
82+
local tc=Duel.GetFirstTarget()
83+
if tc:IsRelateToEffect(e) then
84+
Duel.Destroy(tc,REASON_EFFECT)
85+
end
86+
end

pre-release/c101301083.lua

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
--Japanese name
2+
--Mutiny in the Sky
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Fusion Summon 1 Fiend or Fairy Fusion Monster from your Extra Deck, by shuffling Fiend and/or Fairy monsters from your GY into the Deck
7+
local e1=Fusion.CreateSummonEff(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND|RACE_FAIRY),aux.FALSE,s.fextra,Fusion.ShuffleMaterial)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCountLimit(1,id)
10+
c:RegisterEffect(e1)
11+
--Add this card to your hand
12+
local e2=Effect.CreateEffect(c)
13+
e2:SetDescription(aux.Stringid(id,1))
14+
e2:SetCategory(CATEGORY_TOHAND)
15+
e2:SetType(EFFECT_TYPE_IGNITION)
16+
e2:SetRange(LOCATION_GRAVE)
17+
e2:SetCountLimit(1,{id,1})
18+
e2:SetCost(s.thcost)
19+
e2:SetTarget(s.thtg)
20+
e2:SetOperation(s.thop)
21+
c:RegisterEffect(e2)
22+
end
23+
function s.matfilter(c)
24+
return c:IsRace(RACE_FIEND|RACE_FAIRY) and c:IsAbleToDeck()
25+
end
26+
function s.fextra(e,tp,mg)
27+
return Duel.GetMatchingGroup(s.matfilter,tp,LOCATION_GRAVE,0,nil)
28+
end
29+
function s.thcostfilter(c)
30+
return c:IsRace(RACE_FIEND|RACE_FAIRY) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsAbleToGraveAsCost()
31+
end
32+
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
33+
if chk==0 then return Duel.IsExistingMatchingCard(s.thcostfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil) end
34+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
35+
local g=Duel.SelectMatchingCard(tp,s.thcostfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil)
36+
Duel.SendtoGrave(g,REASON_COST)
37+
end
38+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
39+
local c=e:GetHandler()
40+
if chk==0 then return c:IsAbleToHand() end
41+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0)
42+
end
43+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
44+
local c=e:GetHandler()
45+
if c:IsRelateToEffect(e) then
46+
Duel.SendtoHand(c,nil,REASON_EFFECT)
47+
end
48+
end

pre-release/c101301087.lua

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
--
2+
--Steel-Stringed Sacrifice
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Activate 1 of these effects
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_IGNITION)
10+
e1:SetRange(LOCATION_HAND|LOCATION_GRAVE)
11+
e1:SetCost(s.effcost)
12+
e1:SetTarget(s.efftg)
13+
e1:SetOperation(s.effop)
14+
c:RegisterEffect(e1)
15+
end
16+
function s.effcostfilter(c)
17+
return c:IsLevelAbove(5) and not c:IsPublic()
18+
end
19+
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
20+
if chk==0 then return Duel.IsExistingMatchingCard(s.effcostfilter,tp,LOCATION_HAND,0,1,nil) end
21+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
22+
local rc=Duel.SelectMatchingCard(tp,s.effcostfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
23+
Duel.ConfirmCards(1-tp,rc)
24+
Duel.ShuffleHand(tp)
25+
e:SetLabelObject(rc)
26+
e:SetLabel(rc:GetOriginalCodeRule())
27+
rc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
28+
end
29+
function s.thfilter(c)
30+
return c:IsLevelAbove(5) and c:IsAbleToHand()
31+
end
32+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
33+
local c=e:GetHandler()
34+
local b1=c:IsLocation(LOCATION_HAND) and not Duel.HasFlagEffect(tp,id)
35+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
36+
local b2=c:IsLocation(LOCATION_GRAVE) and not Duel.HasFlagEffect(tp,id+100) and c:IsAbleToHand()
37+
local b3=c:IsLocation(LOCATION_GRAVE) and not Duel.HasFlagEffect(tp,id+200)
38+
and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,c)
39+
if chk==0 then return b1 or b2 or b3 end
40+
local op=Duel.SelectEffect(tp,
41+
{b1,aux.Stringid(id,2)},
42+
{b2,aux.Stringid(id,3)},
43+
{b3,aux.Stringid(id,4)})
44+
Duel.SetTargetParam(op)
45+
Duel.RegisterFlagEffect(tp,id+(op-1)*100,RESET_PHASE|PHASE_END,0,1)
46+
if op==1 then
47+
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
48+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
49+
elseif op==2 then
50+
e:SetCategory(CATEGORY_TOHAND)
51+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0)
52+
elseif op==3 then
53+
e:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
54+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,tp,0)
55+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
56+
end
57+
end
58+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
59+
local c=e:GetHandler()
60+
local code=e:GetLabel()
61+
local rc=e:GetLabelObject()
62+
aux.RegisterClientHint(c,0,tp,1,0,aux.Stringid(id,5))
63+
--Register if the player Normal Summons the revealed monster or a monster with the same original name
64+
local e1=Effect.CreateEffect(c)
65+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
66+
e1:SetCode(EVENT_SUMMON_SUCCESS)
67+
e1:SetCountLimit(1)
68+
e1:SetCondition(function(e,tp,eg,ep) return ep==tp and ((rc:HasFlagEffect(id) and eg:IsContains(rc) and rc:IsFaceup()) or eg:IsExists(aux.FaceupFilter(Card.IsOriginalCodeRule,code),1,nil)) end)
69+
e1:SetOperation(function(e) e:SetLabel(1) end)
70+
e1:SetReset(RESET_PHASE|PHASE_END)
71+
Duel.RegisterEffect(e1,tp)
72+
--During the End Phase of this turn, lose 1000 LP if you did not Normal Summon the revealed monster, or a monster with the same original name
73+
local e2=e1:Clone()
74+
e2:SetDescription(aux.Stringid(id,6))
75+
e2:SetCode(EVENT_PHASE+PHASE_END)
76+
e2:SetCondition(function() return e1:GetLabel()==0 end)
77+
e2:SetOperation(function(e,tp) Duel.SetLP(tp,Duel.GetLP(tp)-1000) end)
78+
Duel.RegisterEffect(e2,tp)
79+
if not c:IsRelateToEffect(e) then return end
80+
local op=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
81+
if op==1 then
82+
--Special Summon this card from your hand
83+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
84+
elseif op==2 then
85+
--Add this card from your GY to your hand
86+
Duel.SendtoHand(c,nil,REASON_EFFECT)
87+
Duel.ConfirmCards(1-tp,c)
88+
elseif op==3 then
89+
--Banish this card from your GY, and if you do, add 1 Level 5 or higher monster from your GY to your hand
90+
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)==0 or not c:IsLocation(LOCATION_REMOVED) then return end
91+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
92+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
93+
if #g>0 then
94+
Duel.HintSelection(g)
95+
Duel.SendtoHand(g,nil,REASON_EFFECT)
96+
end
97+
end
98+
end

0 commit comments

Comments
 (0)