Skip to content

Commit dbd71ec

Browse files
authored
Added new card scripts
1 parent cba69a2 commit dbd71ec

File tree

2 files changed

+203
-0
lines changed

2 files changed

+203
-0
lines changed

pre-release/c100451009.lua

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
--シンクロ・エマージェンシー
2+
--Synchro Emergency
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If only your opponent controls a monster, you can activate this card from your hand
7+
local e0=Effect.CreateEffect(c)
8+
e0:SetType(EFFECT_TYPE_SINGLE)
9+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
10+
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
11+
e0:SetCondition(function(e) local tp=e:GetHandlerPlayer() return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end)
12+
c:RegisterEffect(e0)
13+
--Special Summon 1 monster from your hand (but negate its effects), then if your opponent controls a monster Special Summoned from the Extra Deck, you can Special Summon 1 "Synchron" monster from your Deck. Until the end of the next turn after this card resolves, you cannot Special Summon from the Extra Deck, except Synchro Monsters
14+
local e1=Effect.CreateEffect(c)
15+
e1:SetDescription(aux.Stringid(id,0))
16+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
17+
e1:SetType(EFFECT_TYPE_ACTIVATE)
18+
e1:SetCode(EVENT_FREE_CHAIN)
19+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
20+
e1:SetTarget(s.target)
21+
e1:SetOperation(s.activate)
22+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E|TIMING_CHAIN_END)
23+
c:RegisterEffect(e1)
24+
--You can banish this card from your GY; immediately after this effect resolves, Synchro Summon 1 Synchro Monster
25+
local e2=Effect.CreateEffect(c)
26+
e2:SetDescription(aux.Stringid(id,1))
27+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
28+
e2:SetType(EFFECT_TYPE_QUICK_O)
29+
e2:SetCode(EVENT_FREE_CHAIN)
30+
e2:SetRange(LOCATION_GRAVE)
31+
e2:SetCost(Cost.SelfBanish)
32+
e2:SetTarget(s.synctg)
33+
e2:SetOperation(s.syncop)
34+
e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E|TIMING_CHAIN_END)
35+
c:RegisterEffect(e2)
36+
end
37+
s.listed_series={SET_SYNCHRON}
38+
function s.handspfilter(c,e,tp)
39+
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
40+
end
41+
function s.target(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.handspfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
44+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
45+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
46+
end
47+
function s.deckspfilter(c,e,tp)
48+
return c:IsSetCard(SET_SYNCHRON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
49+
end
50+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
51+
local c=e:GetHandler()
52+
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
53+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
54+
local sc=Duel.SelectMatchingCard(tp,s.handspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
55+
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
56+
--Negate its effects
57+
sc:NegateEffects(c)
58+
if Duel.SpecialSummonComplete()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
59+
and Duel.IsExistingMatchingCard(Card.IsSummonLocation,tp,0,LOCATION_MZONE,1,nil,LOCATION_EXTRA)
60+
and Duel.IsExistingMatchingCard(s.deckspfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
61+
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
62+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
63+
local g=Duel.SelectMatchingCard(tp,s.deckspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
64+
if #g>0 then
65+
Duel.BreakEffect()
66+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
67+
end
68+
end
69+
end
70+
end
71+
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
72+
--Until the end of the next turn after this card resolves, you cannot Special Summon from the Extra Deck, except Synchro Monsters
73+
local e1=Effect.CreateEffect(c)
74+
e1:SetDescription(aux.Stringid(id,3))
75+
e1:SetType(EFFECT_TYPE_FIELD)
76+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
77+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
78+
e1:SetTargetRange(1,0)
79+
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsSynchroMonster() end)
80+
e1:SetReset(RESET_PHASE|PHASE_END,2)
81+
Duel.RegisterEffect(e1,tp)
82+
end
83+
function s.synctg(e,tp,eg,ep,ev,re,r,rp,chk)
84+
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil) end
85+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
86+
end
87+
function s.syncop(e,tp,eg,ep,ev,re,r,rp)
88+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
89+
local synchro=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst()
90+
if synchro then
91+
Duel.SynchroSummon(tp,synchro,nil)
92+
end
93+
end

pre-release/c100451012.lua

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
--ガガガガール-ゼロゼロコール
2+
--Gagaga Girl - Cell Phone Subtraction
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If your opponent Special Summons a monster(s) from the Extra Deck: You can target 1 face-up monster you control; Special Summon this card from your hand, then immediately after this effect resolves, Xyz Summon using only this card and the targeted monster. When you do, treat this card's Level as the same as the targeted monster's
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
12+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
13+
e1:SetRange(LOCATION_HAND)
14+
e1:SetCountLimit(1,{id,0})
15+
e1:SetCondition(s.spcon)
16+
e1:SetTarget(s.sptg)
17+
e1:SetOperation(s.spop)
18+
c:RegisterEffect(e1)
19+
--If this card is detached from an Xyz Monster to activate that monster's effect: You can change the ATK of 1 face-up monster your opponent controls to 0
20+
local e2a=Effect.CreateEffect(c)
21+
e2a:SetDescription(aux.Stringid(id,1))
22+
e2a:SetCategory(CATEGORY_ATKCHANGE)
23+
e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
24+
e2a:SetProperty(EFFECT_FLAG_DELAY)
25+
e2a:SetCode(EVENT_TO_GRAVE)
26+
e2a:SetCountLimit(1,{id,1})
27+
e2a:SetCondition(s.atkcon)
28+
e2a:SetTarget(s.atktg)
29+
e2a:SetOperation(s.atkop)
30+
c:RegisterEffect(e2a)
31+
local e2b=e2a:Clone()
32+
e2b:SetCode(EVENT_REMOVE)
33+
c:RegisterEffect(e2b)
34+
end
35+
function s.spconfilter(c,opp)
36+
return c:IsSummonPlayer(opp) and c:IsSummonLocation(LOCATION_EXTRA)
37+
end
38+
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
39+
return eg:IsExists(s.spconfilter,1,nil,1-tp)
40+
end
41+
function s.tgfilter(c,tp,hc)
42+
if not (c:IsFaceup() and c:HasLevel()) then return false end
43+
--When you do, treat this card's Level as the same as the targeted monster's
44+
local e1=Effect.CreateEffect(hc)
45+
e1:SetType(EFFECT_TYPE_SINGLE)
46+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
47+
e1:SetCode(EFFECT_XYZ_LEVEL)
48+
e1:SetValue(c:GetLevel())
49+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
50+
hc:RegisterEffect(e1,true)
51+
local res=Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,Group.FromCards(c,hc),2,2)
52+
if e1 then e1:Reset() end
53+
return res
54+
end
55+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
56+
local c=e:GetHandler()
57+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc,tp,c) end
58+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
59+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
60+
and Duel.IsPlayerCanSpecialSummonCount(tp,2)
61+
and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) end
62+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
63+
local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
64+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
65+
end
66+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
67+
local c=e:GetHandler()
68+
local tc=Duel.GetFirstTarget()
69+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then
70+
local mg=Group.FromCards(c,tc)
71+
--When you do, treat this card's Level as the same as the targeted monster's
72+
local e1=Effect.CreateEffect(c)
73+
e1:SetType(EFFECT_TYPE_SINGLE)
74+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
75+
e1:SetCode(EFFECT_XYZ_LEVEL)
76+
e1:SetValue(tc:GetLevel())
77+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
78+
c:RegisterEffect(e1,true)
79+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
80+
local xyz=Duel.SelectMatchingCard(tp,Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil,mg,2,2):GetFirst()
81+
if xyz then
82+
Duel.XyzSummon(tp,xyz,mg,nil,2,2)
83+
else
84+
if e1 then e1:Reset() end
85+
end
86+
end
87+
end
88+
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
89+
local c=e:GetHandler()
90+
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ) and c:IsPreviousLocation(LOCATION_OVERLAY)
91+
end
92+
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
93+
if chk==0 then return Duel.IsExistingMatchingCard(Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,1,nil) end
94+
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,nil,1,1-tp,0)
95+
end
96+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
97+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF)
98+
local sc=Duel.SelectMatchingCard(tp,Card.HasNonZeroAttack,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
99+
if sc then
100+
Duel.HintSelection(sc)
101+
--Its ATK becomes 0
102+
local e1=Effect.CreateEffect(e:GetHandler())
103+
e1:SetType(EFFECT_TYPE_SINGLE)
104+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
105+
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
106+
e1:SetValue(0)
107+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
108+
sc:RegisterEffect(e1)
109+
end
110+
end

0 commit comments

Comments
 (0)