Skip to content

Commit 2a070ea

Browse files
authored
Added new card scripts
1 parent 89ee4c8 commit 2a070ea

3 files changed

Lines changed: 165 additions & 0 deletions

File tree

pre-release/c100200267.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
--月の魔術師
2+
--Moon Magician
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If your opponent controls an Xyz Monster, you can Special Summon this card (from your hand)
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_FIELD)
10+
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
11+
e1:SetCode(EFFECT_SPSUMMON_PROC)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
14+
e1:SetCondition(s.selfspcon)
15+
c:RegisterEffect(e1)
16+
--Special Summon 1 Level 4 LIGHT monster from your GY
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetDescription(aux.Stringid(id,1))
19+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
20+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
21+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
22+
e2:SetCode(EVENT_SUMMON_SUCCESS)
23+
e2:SetCountLimit(1,{id,1})
24+
e2:SetTarget(s.sptg)
25+
e2:SetOperation(s.spop)
26+
c:RegisterEffect(e2)
27+
local e3=e2:Clone()
28+
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
29+
c:RegisterEffect(e3)
30+
end
31+
s.listed_names={id}
32+
function s.selfspcon(e,c)
33+
if c==nil then return true end
34+
local tp=c:GetControler()
35+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
36+
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsType,TYPE_XYZ),tp,0,LOCATION_MZONE,1,nil)
37+
end
38+
function s.spfilter(c,e,tp)
39+
return c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
40+
end
41+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
42+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
43+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
44+
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
45+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
46+
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
47+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
48+
end
49+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
50+
local tc=Duel.GetFirstTarget()
51+
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
52+
--Negate its effects
53+
tc:NegateEffects(e:GetHandler())
54+
end
55+
Duel.SpecialSummonComplete()
56+
end

pre-release/c100200268.lua

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
--ムーン・ガードナー
2+
--Moon Gardna
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If your opponent controls 2 or more monsters, you can Special Summon this card (from your hand)
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_FIELD)
10+
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
11+
e1:SetCode(EFFECT_SPSUMMON_PROC)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
14+
e1:SetCondition(s.spcon)
15+
c:RegisterEffect(e1)
16+
--Add 1 Level 4 LIGHT monster from your GY to your hand
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetDescription(aux.Stringid(id,1))
19+
e2:SetCategory(CATEGORY_TOHAND)
20+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
21+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
22+
e2:SetCode(EVENT_SUMMON_SUCCESS)
23+
e2:SetCountLimit(1,{id,1})
24+
e2:SetTarget(s.thtg)
25+
e2:SetOperation(s.thop)
26+
c:RegisterEffect(e2)
27+
local e3=e2:Clone()
28+
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
29+
c:RegisterEffect(e3)
30+
end
31+
s.listed_names={id}
32+
function s.spcon(e,c)
33+
if c==nil then return true end
34+
local tp=c:GetControler()
35+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>=2
36+
end
37+
function s.thfilter(c)
38+
return c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsCode(id) and c:IsAbleToHand()
39+
end
40+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
41+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end
42+
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil,nil)
43+
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>=1 end
44+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
45+
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
46+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0)
47+
end
48+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
49+
local tc=Duel.GetFirstTarget()
50+
if tc:IsRelateToEffect(e) then
51+
Duel.SendtoHand(tc,nil,REASON_EFFECT)
52+
end
53+
end

pre-release/c100200269.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
--スターシップ・アジャスト・プレーン
2+
--Starship Adjust Plane
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--The Levels of both this card and 1 other Machine monster you control become their combined current Levels
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_LVCHANGE)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
12+
e1:SetRange(LOCATION_MZONE)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.lvtg)
15+
e1:SetOperation(s.lvop)
16+
c:RegisterEffect(e1)
17+
end
18+
function s.lvlfilter(c)
19+
return c:IsFaceup() and c:HasLevel() and c:IsRace(RACE_MACHINE)
20+
end
21+
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
22+
local c=e:GetHandler()
23+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvlfilter(chkc) and chkc~=c end
24+
if chk==0 then return c:HasLevel() and Duel.IsExistingTarget(s.lvlfilter,tp,LOCATION_MZONE,0,1,c) end
25+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
26+
local g=Duel.SelectTarget(tp,s.lvlfilter,tp,LOCATION_MZONE,0,1,1,c)
27+
g:AddCard(c)
28+
Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,g,2,tp,g:GetSum(Card.GetLevel))
29+
end
30+
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
31+
local c=e:GetHandler()
32+
local tc=Duel.GetFirstTarget()
33+
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
34+
local lv=c:GetLevel()+tc:GetLevel()
35+
--The Levels of both become their combined current Levels
36+
local e1=Effect.CreateEffect(c)
37+
e1:SetType(EFFECT_TYPE_SINGLE)
38+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
39+
e1:SetCode(EFFECT_CHANGE_LEVEL)
40+
e1:SetValue(lv)
41+
e1:SetReset(RESETS_STANDARD_PHASE_END)
42+
c:RegisterEffect(e1)
43+
local e2=e1:Clone()
44+
tc:RegisterEffect(e2)
45+
end
46+
--You cannot Special Summon monsters from the Extra Deck for the rest of this turn, except Machine Xyz Monsters
47+
local e3=Effect.CreateEffect(c)
48+
e3:SetDescription(aux.Stringid(id,1))
49+
e3:SetType(EFFECT_TYPE_FIELD)
50+
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
51+
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
52+
e3:SetTargetRange(1,0)
53+
e3:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not (c:IsRace(RACE_MACHINE) and c:IsType(TYPE_XYZ)) end)
54+
e3:SetReset(RESET_PHASE|PHASE_END)
55+
Duel.RegisterEffect(e3,tp)
56+
end

0 commit comments

Comments
 (0)