Skip to content

Commit 922a8d4

Browse files
authored
Added new card scripts
1 parent d1bcefa commit 922a8d4

File tree

5 files changed

+457
-0
lines changed

5 files changed

+457
-0
lines changed

pre-release/c101301028.lua

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
--WAKE CUP! モカ
2+
--WAKE CUP! Mocha
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Make 1 monster on the field gain 1000 ATK, but send it to the GY during the End Phase
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_TOGRAVE)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
12+
e1:SetCode(EVENT_FLIP)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.atktg)
15+
e1:SetOperation(s.atkop)
16+
c:RegisterEffect(e1)
17+
--Special Summon this card from your hand, and if you do, change that monster to Attack Position
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
23+
e2:SetRange(LOCATION_HAND)
24+
e2:SetCountLimit(1,{id,1})
25+
e2:SetTarget(s.sptg)
26+
e2:SetOperation(s.spop)
27+
c:RegisterEffect(e2)
28+
--Change this card to face-down Defense Position
29+
local e3=Effect.CreateEffect(c)
30+
e3:SetDescription(aux.Stringid(id,2))
31+
e3:SetCategory(CATEGORY_POSITION)
32+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
33+
e3:SetCode(EVENT_PHASE+PHASE_END)
34+
e3:SetRange(LOCATION_MZONE)
35+
e3:SetCountLimit(1)
36+
e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
37+
e3:SetTarget(s.postg)
38+
e3:SetOperation(s.posop)
39+
c:RegisterEffect(e3)
40+
end
41+
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
42+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
43+
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
44+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF)
45+
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
46+
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,tp,1000)
47+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,g,1,tp,0)
48+
end
49+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
50+
local tc=Duel.GetFirstTarget()
51+
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
52+
--It gains 1000 ATK
53+
local e1=Effect.CreateEffect(e:GetHandler())
54+
e1:SetType(EFFECT_TYPE_SINGLE)
55+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
56+
e1:SetCode(EFFECT_UPDATE_ATTACK)
57+
e1:SetValue(1000)
58+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
59+
tc:RegisterEffect(e1)
60+
--Send it to the GY during the End Phase
61+
aux.DelayedOperation(tc,PHASE_END,id,e,tp,
62+
function(dg) Duel.SendtoGrave(dg,REASON_EFFECT) end,
63+
nil,0,1,aux.Stringid(id,3),aux.Stringid(id,4)
64+
)
65+
end
66+
end
67+
function s.posfilter(c)
68+
return c:IsFacedown() and c:IsDefensePos() and c:IsCanChangePosition()
69+
end
70+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
71+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.posfilter(chkc) end
72+
local c=e:GetHandler()
73+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0
74+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
75+
and Duel.IsExistingTarget(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
76+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
77+
local g=Duel.SelectTarget(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
78+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
79+
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,tp,0)
80+
end
81+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
82+
local c=e:GetHandler()
83+
local tc=Duel.GetFirstTarget()
84+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0
85+
and tc:IsRelateToEffect(e) then
86+
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
87+
end
88+
end
89+
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
90+
local c=e:GetHandler()
91+
if chk==0 then return c:IsCanTurnSet() end
92+
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,tp,POS_FACEDOWN_DEFENSE)
93+
end
94+
function s.posop(e,tp,eg,ep,ev,re,r,rp)
95+
local c=e:GetHandler()
96+
if c:IsRelateToEffect(e) then
97+
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
98+
end
99+
end

pre-release/c101301041.lua

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
--THE・スターハム
2+
--The Star Ham
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+
--Special Summon 1 monster from your GY that was used as material for this card's Synchro Summon, and if you do, it is treated as a Tuner
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
13+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
14+
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
15+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
16+
e1:SetCountLimit(1,id)
17+
e1:SetCondition(s.gyspcon)
18+
e1:SetCost(Cost.Discard())
19+
e1:SetTarget(s.gysptg)
20+
e1:SetOperation(s.gyspop)
21+
c:RegisterEffect(e1)
22+
--Special Summon this card, but banish it when it leaves the field
23+
local e2=Effect.CreateEffect(c)
24+
e2:SetDescription(aux.Stringid(id,1))
25+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
26+
e2:SetType(EFFECT_TYPE_IGNITION)
27+
e2:SetRange(LOCATION_GRAVE)
28+
e2:SetCountLimit(1,{id,1})
29+
e2:SetCost(Cost.Discard(nil,false,2))
30+
e2:SetTarget(s.selfsptg)
31+
e2:SetOperation(s.selfspop)
32+
c:RegisterEffect(e2)
33+
end
34+
function s.gyspcon(e,tp,eg,ep,ev,re,r,rp)
35+
local c=e:GetHandler()
36+
return c:IsSynchroSummoned() and c:GetMaterialCount()>0
37+
end
38+
function s.gyspfilter(c,e,tp,sync)
39+
return sync:IsReasonCard(c) and c:IsReason(REASON_SYNCHRO) and c:IsReason(REASON_MATERIAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
40+
end
41+
function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk)
42+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
43+
and Duel.IsExistingMatchingCard(s.gyspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,e:GetHandler()) end
44+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
45+
end
46+
function s.gyspop(e,tp,eg,ep,ev,re,r,rp)
47+
local c=e:GetHandler()
48+
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
49+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
50+
local sc=Duel.SelectMatchingCard(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,c):GetFirst()
51+
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 and not sc:IsType(TYPE_TUNER) then
52+
--It is treated as a Tuner
53+
local e1=Effect.CreateEffect(c)
54+
e1:SetType(EFFECT_TYPE_SINGLE)
55+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
56+
e1:SetCode(EFFECT_ADD_TYPE)
57+
e1:SetValue(TYPE_TUNER)
58+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
59+
sc:RegisterEffect(e1)
60+
end
61+
end
62+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
63+
local c=e:GetHandler()
64+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
65+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
66+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
67+
end
68+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
69+
local c=e:GetHandler()
70+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
71+
--Banish it when it leaves the field
72+
local e1=Effect.CreateEffect(c)
73+
e1:SetDescription(3300)
74+
e1:SetType(EFFECT_TYPE_SINGLE)
75+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
76+
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
77+
e1:SetValue(LOCATION_REMOVED)
78+
e1:SetReset(RESET_EVENT|RESETS_REDIRECT)
79+
c:RegisterEffect(e1,true)
80+
end
81+
end

pre-release/c101301072.lua

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
--急雷の泥沼
2+
--Sudden Thunderous Swamp
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--When this card is activated: You can discard 1 card, and if you do, Set 1 Continuous Trap from your Deck or GY, with an effect that Special Summons itself as a monster, except the discarded card
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_HANDES)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
13+
e1:SetOperation(s.activate)
14+
c:RegisterEffect(e1)
15+
--Add 1 card with the same name as 1 of your destroyed cards from your Deck to your hand
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,1))
18+
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
19+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
20+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
21+
e2:SetCode(EVENT_CUSTOM+id)
22+
e2:SetRange(LOCATION_SZONE)
23+
e2:SetCountLimit(1,{id,1})
24+
e2:SetTarget(s.thtg)
25+
e2:SetOperation(s.thop)
26+
c:RegisterEffect(e2)
27+
local g=Group.CreateGroup()
28+
g:KeepAlive()
29+
e2:SetLabelObject(g)
30+
--Keep track of cards destroyed on your field
31+
local e3=Effect.CreateEffect(c)
32+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
33+
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
34+
e3:SetCode(EVENT_DESTROYED)
35+
e3:SetRange(LOCATION_SZONE)
36+
e3:SetLabelObject(e2)
37+
e3:SetOperation(s.regop)
38+
c:RegisterEffect(e3)
39+
end
40+
function s.setfilter(c)
41+
return c:IsContinuousTrap() and c:IsTrapMonster() and c:IsSSetable()
42+
end
43+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
44+
if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT)
45+
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.setfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil)
46+
and Duel.SelectYesNo(tp,aux.Stringid(id,2))
47+
and Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_DISCARD|REASON_EFFECT)>0 then
48+
local og=Duel.GetOperatedGroup()
49+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
50+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,og)
51+
if #g>0 then
52+
Duel.SSet(tp,g)
53+
end
54+
end
55+
end
56+
function s.tgfilter(c,e,tp)
57+
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsCanBeEffectTarget(e) and c:IsReason(REASON_BATTLE|REASON_EFFECT)
58+
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
59+
end
60+
function s.thfilter(c,code)
61+
return c:IsCode(code) and c:IsAbleToHand()
62+
end
63+
function s.regop(e,tp,eg,ep,ev,re,r,rp)
64+
local tg=eg:Filter(s.tgfilter,nil,e,tp)
65+
if #tg>0 then
66+
for tc in tg:Iter() do
67+
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
68+
end
69+
local g=e:GetLabelObject():GetLabelObject()
70+
if Duel.GetCurrentChain()==0 then g:Clear() end
71+
g:Merge(tg)
72+
g:Remove(function(c) return c:GetFlagEffect(id)==0 end,nil)
73+
e:GetLabelObject():SetLabelObject(g)
74+
Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,tp,tp,0)
75+
end
76+
end
77+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
78+
local g=e:GetLabelObject():Filter(s.tgfilter,nil,e,tp)
79+
if chkc then return g:IsContains(chkc) and s.tgfilter(chkc,e,tp) end
80+
if chk==0 then return #g>0 end
81+
local tc=nil
82+
if #g>1 then
83+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
84+
tc=g:Select(tp,1,1,nil):GetFirst()
85+
else
86+
tc=g:GetFirst()
87+
end
88+
Duel.SetTargetCard(tc)
89+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
90+
end
91+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
92+
local tc=Duel.GetFirstTarget()
93+
if tc:IsRelateToEffect(e) then
94+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
95+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
96+
if #g>0 then
97+
Duel.SendtoHand(g,nil,REASON_EFFECT)
98+
Duel.ConfirmCards(1-tp,g)
99+
end
100+
end
101+
end

pre-release/c101301079.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
--誤出荷
2+
--Shipment Error
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--An activated effect becomes "Your opponent takes 1 card from their Deck for you to add to your hand, and you must keep that card revealed"
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_ACTIVATE)
10+
e1:SetCode(EVENT_CHAINING)
11+
e1:SetCondition(s.changecon)
12+
e1:SetTarget(s.changetg)
13+
e1:SetOperation(s.changeop)
14+
c:RegisterEffect(e1)
15+
end
16+
function s.changecon(e,tp,eg,ep,ev,re,r,rp)
17+
if re:IsHasCategory(CATEGORY_SEARCH) or re:IsHasCategory(CATEGORY_DRAW) then return true end
18+
local ex1,g1,gc1,dp1,loc1=Duel.GetOperationInfo(ev,CATEGORY_TOHAND)
19+
local ex2,g2,gc2,dp2,loc2=Duel.GetPossibleOperationInfo(ev,CATEGORY_TOHAND)
20+
local g=Group.CreateGroup()
21+
if g1 then g:Merge(g1) end
22+
if g2 then g:Merge(g2) end
23+
return (((loc1 or 0)|(loc2 or 0))&LOCATION_DECK)>0 or (#g>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK))
24+
end
25+
function s.changetg(e,tp,eg,ep,ev,re,r,rp,chk)
26+
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,1-rp,LOCATION_DECK,0,1,nil) end
27+
end
28+
function s.changeop(e,tp,eg,ep,ev,re,r,rp)
29+
local g=Group.CreateGroup()
30+
Duel.ChangeTargetCard(ev,g)
31+
Duel.ChangeChainOperation(ev,s.replaceop)
32+
end
33+
function s.replaceop(e,tp,eg,ep,ev,re,r,rp)
34+
local opp=1-tp
35+
Duel.Hint(HINT_SELECTMSG,opp,aux.Stringid(id,1))
36+
local sc=Duel.SelectMatchingCard(opp,Card.IsAbleToHand,opp,LOCATION_DECK,0,1,1,nil):GetFirst()
37+
if sc and Duel.SendtoHand(sc,tp,REASON_EFFECT)>0 then
38+
local c=e:GetHandler()
39+
--Keep it revealed
40+
local e1=Effect.CreateEffect(c)
41+
e1:SetDescription(aux.Stringid(id,2))
42+
e1:SetType(EFFECT_TYPE_SINGLE)
43+
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
44+
e1:SetCode(EFFECT_PUBLIC)
45+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
46+
sc:RegisterEffect(e1)
47+
--During the End Phase of this turn, shuffle it into the Deck, and if you do, draw 1 card
48+
aux.DelayedOperation(sc,PHASE_END,id,e,tp,
49+
function()
50+
if Duel.SendtoDeck(sc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_DECK) then
51+
Duel.Draw(tp,1,REASON_EFFECT)
52+
end
53+
end
54+
)
55+
end
56+
end

0 commit comments

Comments
 (0)