Skip to content

Commit 332a89a

Browse files
authored
Added new card scripts
1 parent 3347a5f commit 332a89a

File tree

3 files changed

+241
-0
lines changed

3 files changed

+241
-0
lines changed

pre-release/c100443007.lua

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
--プリマの光
2+
--Prima Light
3+
--scripted by pyrQ
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_ACTIVATE)
10+
e1:SetCode(EVENT_FREE_CHAIN)
11+
e1:SetCountLimit(1,id)
12+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
13+
e1:SetTarget(s.efftg)
14+
e1:SetOperation(s.effop)
15+
c:RegisterEffect(e1)
16+
--Add 1 Warrior or Fairy "Cyber" monster from your Deck to your hand
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetDescription(aux.Stringid(id,1))
19+
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
20+
e2:SetType(EFFECT_TYPE_IGNITION)
21+
e2:SetRange(LOCATION_GRAVE)
22+
e2:SetCountLimit(1,id)
23+
e2:SetCost(Cost.SelfBanish)
24+
e2:SetTarget(s.thtg)
25+
e2:SetOperation(s.thop)
26+
c:RegisterEffect(e2)
27+
end
28+
s.listed_series={SET_CYBER}
29+
function s.tribfilter(c,tp)
30+
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_WARRIOR) and c:IsReleasableByEffect() and Duel.GetMZoneCount(tp,c)>0
31+
end
32+
function s.spfilter(c,e,tp)
33+
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
34+
end
35+
function s.nsfilter(c)
36+
return c:IsRace(RACE_WARRIOR) and c:IsSummonable(true,nil)
37+
end
38+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
39+
local b1=Duel.CheckReleaseGroup(tp,s.tribfilter,1,nil,tp)
40+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp)
41+
local b2=Duel.IsMainPhase() and Duel.IsExistingMatchingCard(s.nsfilter,tp,LOCATION_HAND,0,1,nil)
42+
if chk==0 then return b1 or b2 end
43+
local op=Duel.SelectEffect(tp,
44+
{b1,aux.Stringid(id,2)},
45+
{b2,aux.Stringid(id,3)})
46+
e:SetLabel(op)
47+
if op==1 then
48+
e:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
49+
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
50+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
51+
elseif op==2 then
52+
e:SetCategory(CATEGORY_SUMMON)
53+
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND)
54+
end
55+
end
56+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
57+
local op=e:GetLabel()
58+
if op==1 then
59+
--Tribute 1 EARTH Warrior monster, and if you do, Special Summon 1 LIGHT Warrior monster from your hand or Deck
60+
local rg=Duel.SelectReleaseGroup(tp,s.tribfilter,1,1,nil,tp)
61+
if #rg>0 and Duel.Release(rg,REASON_EFFECT)>0 then
62+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
63+
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp)
64+
if #sg>0 then
65+
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
66+
end
67+
end
68+
elseif op==2 then
69+
--Immediately after this effect resolves, Normal Summon 1 Warrior monster from your hand
70+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
71+
local sc=Duel.SelectMatchingCard(tp,s.nsfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
72+
if sc then
73+
Duel.Summon(tp,sc,true,nil)
74+
end
75+
end
76+
end
77+
function s.thfilter(c)
78+
return c:IsRace(RACE_WARRIOR|RACE_FAIRY) and c:IsSetCard(SET_CYBER) and c:IsAbleToHand()
79+
end
80+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
81+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
82+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
83+
end
84+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
85+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
86+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
87+
if #g>0 then
88+
Duel.SendtoHand(g,nil,REASON_EFFECT)
89+
Duel.ConfirmCards(1-tp,g)
90+
end
91+
end

pre-release/c101301021.lua

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
--正義の伝説 カイバーマン
2+
--Legend of Justice Kaibaman
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Show 3 "Blue-Eyes White Dragon" in your hand/Deck/field/GY, then Special Summon 1 "Blue-Eyes White Dragon" from your hand, Deck, or GY
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY)
12+
e1:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.sptg)
15+
e1:SetOperation(s.spop)
16+
c:RegisterEffect(e1)
17+
local e2=e1:Clone()
18+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
19+
c:RegisterEffect(e2)
20+
--Add 1 "Blue-Eyes" monster from your Deck to your hand
21+
local e3=Effect.CreateEffect(c)
22+
e3:SetDescription(aux.Stringid(id,1))
23+
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
24+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
25+
e3:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS)
26+
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
27+
e3:SetRange(LOCATION_GRAVE)
28+
e3:SetCountLimit(1,{id,1})
29+
e3:SetCondition(s.thcon)
30+
e3:SetCost(Cost.SelfBanish)
31+
e3:SetTarget(s.thtg)
32+
e3:SetOperation(s.thop)
33+
c:RegisterEffect(e3)
34+
end
35+
s.listed_names={CARD_BLUEEYES_W_DRAGON}
36+
s.listed_series={SET_BLUE_EYES}
37+
function s.showfilter(c)
38+
return c:IsCode(CARD_BLUEEYES_W_DRAGON) and (c:IsFaceup() or not c:IsOnField())
39+
end
40+
function s.spfilter(c,e,tp)
41+
return c:IsCode(CARD_BLUEEYES_W_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
42+
end
43+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
44+
if chk==0 then return Duel.IsExistingMatchingCard(s.showfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_ONFIELD|LOCATION_GRAVE,0,3,nil)
45+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
46+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp) end
47+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE)
48+
end
49+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
50+
local rg=Duel.GetMatchingGroup(s.showfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_ONFIELD|LOCATION_GRAVE,0,nil)
51+
if #rg>3 then
52+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
53+
rg=Duel.SelectMatchingCard(tp,s.showfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_ONFIELD|LOCATION_GRAVE,0,3,3,nil)
54+
end
55+
if #rg==3 then
56+
local fieldgraveg,handdeckg=rg:Split(Card.IsLocation,nil,LOCATION_ONFIELD|LOCATION_GRAVE)
57+
if #fieldgraveg>0 then Duel.HintSelection(fieldgraveg) end
58+
if #handdeckg>0 then Duel.ConfirmCards(1-tp,handdeckg) end
59+
if rg:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then Duel.ShuffleHand(tp) end
60+
if rg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
61+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
62+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
63+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,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+
function s.thconfilter(c,tp)
71+
return c:IsCode(CARD_BLUEEYES_W_DRAGON) and c:IsFaceup() and c:IsSummonPlayer(tp)
72+
end
73+
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
74+
return eg:IsExists(s.thconfilter,1,nil,tp)
75+
end
76+
function s.thfilter(c)
77+
return c:IsSetCard(SET_BLUE_EYES) and c:IsMonster() and c:IsAbleToHand()
78+
end
79+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
80+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
81+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
82+
end
83+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
84+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
85+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
86+
if #g>0 then
87+
Duel.SendtoHand(g,nil,REASON_EFFECT)
88+
Duel.ConfirmCards(1-tp,g)
89+
end
90+
end

pre-release/c101301047.lua

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
--流麗の騎士ガイアストリーム
2+
--Gaia Stream, the Graceful Force
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 2+ Level 6 monsters OR 1 Rank 5 or 7 Xyz Monster you control
8+
Xyz.AddProcedure(c,nil,6,2,s.ovfilter,aux.Stringid(id,0),99,s.xyzop)
9+
--Cannot be used as material for an Xyz Summon the turn it was Xyz Summoned
10+
local e0=Effect.CreateEffect(c)
11+
e0:SetType(EFFECT_TYPE_SINGLE)
12+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
13+
e0:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
14+
e0:SetCondition(s.matxyzcond)
15+
e0:SetValue(1)
16+
c:RegisterEffect(e0)
17+
--Cannot attack directly
18+
local e1=Effect.CreateEffect(c)
19+
e1:SetType(EFFECT_TYPE_SINGLE)
20+
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
21+
c:RegisterEffect(e1)
22+
--Gains ATK equal to the combined Levels/Ranks of its attached materials x 200
23+
local e2=Effect.CreateEffect(c)
24+
e2:SetType(EFFECT_TYPE_SINGLE)
25+
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
26+
e2:SetCode(EFFECT_UPDATE_ATTACK)
27+
e2:SetRange(LOCATION_MZONE)
28+
e2:SetValue(s.atkval)
29+
c:RegisterEffect(e2)
30+
--Detach 1 material from this card
31+
local e3=Effect.CreateEffect(c)
32+
e3:SetDescription(aux.Stringid(id,0))
33+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
34+
e3:SetCode(EVENT_DAMAGE_STEP_END)
35+
e3:SetOperation(s.detachop)
36+
c:RegisterEffect(e3)
37+
end
38+
s.listed_names={id}
39+
function s.ovfilter(c,tp,lc)
40+
return c:IsRank(5,7) and c:IsType(TYPE_XYZ,lc,SUMMON_TYPE_XYZ,tp) and c:IsFaceup()
41+
end
42+
function s.xyzop(e,tp,chk)
43+
if chk==0 then return not Duel.HasFlagEffect(tp,id) end
44+
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1)
45+
return true
46+
end
47+
function s.matxyzcond(e)
48+
local c=e:GetHandler()
49+
return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsXyzSummoned()
50+
end
51+
function s.atkval(e,c)
52+
local g=e:GetHandler():GetOverlayGroup():Filter(aux.OR(Card.HasLevel,Card.HasRank),nil)
53+
return 200*(g:GetSum(Card.GetLevel)+g:GetSum(Card.GetRank))
54+
end
55+
function s.detachop(e,tp,eg,ep,ev,re,r,rp)
56+
local c=e:GetHandler()
57+
if c:IsRelateToEffect(e) and c:GetOverlayCount()>0 then
58+
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
59+
end
60+
end

0 commit comments

Comments
 (0)