Skip to content

Commit 35cc840

Browse files
authored
Added new card scripts
1 parent f28648a commit 35cc840

14 files changed

+1187
-0
lines changed

pre-release/c100200261.lua

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
--玲瓏竜 クンツァイド
2+
--Dragolithia Kunzite
3+
--Scripted by Eerie Code
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Send 1 Level 7 or higher Normal Monster from your hand or Deck to the GY, and if you do, Special Summon this card
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetRange(LOCATION_HAND)
12+
e1:SetCountLimit(1,id)
13+
e1:SetTarget(s.tgsptg)
14+
e1:SetOperation(s.tgspop)
15+
c:RegisterEffect(e1)
16+
--Special Summon 1 Normal Monster from your GY in Defense Position
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetDescription(aux.Stringid(id,1))
19+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
20+
e2:SetType(EFFECT_TYPE_IGNITION)
21+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
22+
e2:SetRange(LOCATION_GRAVE)
23+
e2:SetCountLimit(1,id)
24+
e2:SetCost(aux.selfbanishcost)
25+
e2:SetTarget(s.gysptg)
26+
e2:SetOperation(s.gyspop)
27+
c:RegisterEffect(e2)
28+
end
29+
function s.tgfilter(c)
30+
return c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7) and c:IsAbleToGrave()
31+
end
32+
function s.tgsptg(e,tp,eg,ep,ev,re,r,rp,chk)
33+
local c=e:GetHandler()
34+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
35+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
36+
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,c) end
37+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
38+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
39+
end
40+
function s.tgspop(e,tp,eg,ep,ev,re,r,rp)
41+
local c=e:GetHandler()
42+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
43+
local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,c):GetFirst()
44+
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE)
45+
and c:IsRelateToEffect(e) then
46+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
47+
end
48+
end
49+
function s.gyspfilter(c,e,tp)
50+
return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
51+
end
52+
function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
53+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.gyspfilter(chkc,e,tp) end
54+
local c=e:GetHandler()
55+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
56+
and Duel.IsExistingTarget(s.gyspfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
57+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
58+
local g=Duel.SelectTarget(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
59+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
60+
end
61+
function s.gyspop(e,tp,eg,ep,ev,re,r,rp)
62+
local tc=Duel.GetFirstTarget()
63+
if tc:IsRelateToEffect(e) then
64+
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
65+
end
66+
end

pre-release/c100306148.lua

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
--Japanese name
2+
--Theia, the Primal Being
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Special Summon this card from your hand
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
10+
e1:SetType(EFFECT_TYPE_QUICK_O)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id)
14+
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
15+
e1:SetCondition(function() return Duel.IsMainPhase() end)
16+
e1:SetCost(s.spcost)
17+
e1:SetTarget(s.sptg)
18+
e1:SetOperation(s.spop)
19+
c:RegisterEffect(e1)
20+
--Neither player can Normal and/or Special Summon more than 4 times per turn while this card is face-up in the Monster Zone
21+
local e2=Effect.CreateEffect(c)
22+
e2:SetType(EFFECT_TYPE_FIELD)
23+
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
24+
e2:SetRange(LOCATION_MZONE)
25+
e2:SetCode(EFFECT_CANNOT_SUMMON)
26+
e2:SetTargetRange(1,1)
27+
e2:SetTarget(function(e,c,tp) return e:GetHandler():GetFlagEffect(id+tp)>=4 end)
28+
c:RegisterEffect(e2)
29+
local e3=e2:Clone()
30+
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
31+
c:RegisterEffect(e3)
32+
--Register a flag to this card everytime Normal and Special Summons happen
33+
local e4=Effect.CreateEffect(c)
34+
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
35+
e4:SetCode(EVENT_SUMMON_SUCCESS)
36+
e4:SetProperty(EFFECT_FLAG_DELAY)
37+
e4:SetRange(LOCATION_MZONE)
38+
e4:SetCondition(function(e,tp,eg) return eg and not eg:IsContains(e:GetHandler()) end)
39+
e4:SetOperation(function(e,tp,eg,ep) e:GetHandler():RegisterFlagEffect(id+ep,RESETS_STANDARD_PHASE_END,0,1) end)
40+
c:RegisterEffect(e4)
41+
local e5=e4:Clone()
42+
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
43+
c:RegisterEffect(e5)
44+
--Special Summon left count
45+
local e6=Effect.CreateEffect(c)
46+
e6:SetType(EFFECT_TYPE_FIELD)
47+
e6:SetCode(EFFECT_LEFT_SPSUMMON_COUNT)
48+
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
49+
e6:SetRange(LOCATION_MZONE)
50+
e6:SetTargetRange(1,1)
51+
e6:SetValue(s.countval)
52+
c:RegisterEffect(e6)
53+
end
54+
function s.spcheck(sg,tp)
55+
return aux.ReleaseCheckMMZ(sg,tp) and sg:CheckWithSumGreater(Card.GetLevel,11,1,99)
56+
end
57+
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
58+
if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.HasLevel,1,99,false,s.spcheck,nil) end
59+
local g=Duel.SelectReleaseGroupCost(tp,Card.HasLevel,1,99,false,s.spcheck,nil)
60+
Duel.Release(g,REASON_COST)
61+
end
62+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
63+
local c=e:GetHandler()
64+
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
65+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
66+
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_EITHER,LOCATION_MZONE)
67+
end
68+
function s.spop(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 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1 then
71+
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil):GetMaxGroup(Card.GetAttack)
72+
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
73+
if #g>1 then
74+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
75+
g=g:Select(tp,1,1,nil)
76+
end
77+
Duel.HintSelection(g)
78+
Duel.BreakEffect()
79+
Duel.Destroy(g,REASON_EFFECT)
80+
end
81+
end
82+
end
83+
function s.countval(e,re,sump)
84+
local ct=e:GetHandler():GetFlagEffect(id+sump)
85+
if ct>=4 then
86+
return 0
87+
else
88+
return 4-ct
89+
end
90+
end

pre-release/c100306149.lua

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
--Japanese name
2+
--Mind Castlin
3+
--Scripted by Eerie Code
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+
--Switch control of 1 opponent's face-up monster and this card
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_CONTROL)
13+
e1:SetType(EFFECT_TYPE_IGNITION)
14+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
15+
e1:SetRange(LOCATION_MZONE)
16+
e1:SetCountLimit(1,{id,0})
17+
e1:SetTarget(s.cttg1)
18+
e1:SetOperation(s.ctop1)
19+
c:RegisterEffect(e1)
20+
--Switch control of 1 face-up monster on each field
21+
local e2=Effect.CreateEffect(c)
22+
e2:SetDescription(aux.Stringid(id,1))
23+
e2:SetCategory(CATEGORY_CONTROL)
24+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
25+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
26+
e2:SetCode(EVENT_TO_GRAVE)
27+
e2:SetCountLimit(1,{id,1})
28+
e2:SetCondition(s.ctcon)
29+
e2:SetTarget(s.cttg2)
30+
e2:SetOperation(s.ctop2)
31+
c:RegisterEffect(e2)
32+
end
33+
function s.ctfilter(c,tp,e)
34+
return c:IsFaceup() and c:IsAbleToChangeControler() and Duel.GetMZoneCount(c:GetControler(),c,tp,LOCATION_REASON_CONTROL)>0
35+
and (not e or c:IsCanBeEffectTarget(e))
36+
end
37+
function s.cttg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
38+
local c=e:GetHandler()
39+
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.ctfilter(chkc,tp) end
40+
if chk==0 then return c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
41+
and Duel.IsExistingTarget(s.ctfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
42+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
43+
local g=Duel.SelectTarget(tp,s.ctfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
44+
g:AddCard(c)
45+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,2,tp,0)
46+
end
47+
function s.ctop1(e,tp,eg,ep,ev,re,r,rp)
48+
local c=e:GetHandler()
49+
local tc=Duel.GetFirstTarget()
50+
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
51+
Duel.SwapControl(c,tc)
52+
end
53+
end
54+
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
55+
local c=e:GetHandler()
56+
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
57+
end
58+
function s.cttg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
59+
if chkc then return false end
60+
if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_MZONE,0,1,nil,tp)
61+
and Duel.IsExistingTarget(s.ctfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
62+
local g=Duel.GetMatchingGroup(s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp,e)
63+
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetControler),1,tp,HINTMSG_CONTROL)
64+
Duel.SetTargetCard(tg)
65+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,tg,2,tp,0)
66+
end
67+
function s.ctop2(e,tp,eg,ep,ev,re,r,rp)
68+
local tg=Duel.GetTargetCards(e)
69+
local c1,c2=tg:GetFirst(),tg:GetNext()
70+
if c1:IsRelateToEffect(e) and c2:IsRelateToEffect(e) then
71+
Duel.SwapControl(c1,c2)
72+
end
73+
end

pre-release/c100306150.lua

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
--Japanese name
2+
--Heavy Polymerization
3+
--Scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
Fusion.RegisterSummonEff{handler=c,mincount=3,extrafil=s.fextra,extratg=s.extratg,extraop=s.extraop,stage2=s.stage2}
7+
end
8+
function s.fcheck(tp,sg,fc)
9+
return sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
10+
end
11+
function s.fextra(e,tp,mg)
12+
local eg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,nil)
13+
if #eg>0 then
14+
return eg,s.fcheck
15+
end
16+
return nil
17+
end
18+
function s.extraop(e,tc,tp,sg)
19+
local rg=sg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
20+
if #rg>0 then
21+
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT|REASON_MATERIAL|REASON_FUSION)
22+
e:SetLabel(rg:GetSum(Card.GetAttack))
23+
sg:Sub(rg)
24+
else
25+
e:SetLabel(0)
26+
end
27+
end
28+
function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk)
29+
if chk==0 then return true end
30+
Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA)
31+
end
32+
function s.stage2(e,tc,tp,sg,chk)
33+
if chk==0 then
34+
local ct=e:GetLabel()
35+
if ct>0 then
36+
Duel.SetLP(tp,Duel.GetLP(tp)-ct)
37+
end
38+
end
39+
end

0 commit comments

Comments
 (0)