Skip to content

Commit 5fee57e

Browse files
authored
Added new card scripts
1 parent 25cc1cf commit 5fee57e

File tree

12 files changed

+1039
-0
lines changed

12 files changed

+1039
-0
lines changed

pre-release/c101303004.lua

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
--磁石の戦士マグネット・テルスリオン
2+
--Tellusrion the Magna Warrior
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
c:AddMustBeSpecialSummoned()
8+
--Must be Special Summoned (from your GY) by banishing 1 "Magnet Warrior Σ+" and 1 "Magnet Warrior Σ-" from your hand, face-up Monster Zone, and/or GY
9+
local e0=Effect.CreateEffect(c)
10+
e0:SetDescription(aux.Stringid(id,0))
11+
e0:SetType(EFFECT_TYPE_FIELD)
12+
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
13+
e0:SetCode(EFFECT_SPSUMMON_PROC)
14+
e0:SetRange(LOCATION_GRAVE)
15+
e0:SetCondition(s.selfspcon)
16+
e0:SetTarget(s.selfsptg)
17+
e0:SetOperation(s.selfspop)
18+
c:RegisterEffect(e0)
19+
--Destroy 1 monster your opponent controlst, or if you targeted an EARTH monster at activation, you can take control of it instead
20+
local e1=Effect.CreateEffect(c)
21+
e1:SetDescription(aux.Stringid(id,1))
22+
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_CONTROL)
23+
e1:SetType(EFFECT_TYPE_QUICK_O)
24+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
25+
e1:SetCode(EVENT_CHAINING)
26+
e1:SetRange(LOCATION_MZONE)
27+
e1:SetCountLimit(1)
28+
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp end)
29+
e1:SetTarget(s.destg)
30+
e1:SetOperation(s.desop)
31+
c:RegisterEffect(e1)
32+
--Special Summon 2 of your banished "Magnet Warrior Σ" monsters
33+
local e2=Effect.CreateEffect(c)
34+
e2:SetDescription(aux.Stringid(id,1))
35+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
36+
e2:SetType(EFFECT_TYPE_QUICK_O)
37+
e2:SetCode(EVENT_FREE_CHAIN)
38+
e2:SetRange(LOCATION_MZONE)
39+
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end)
40+
e2:SetCost(Cost.SelfTribute)
41+
e2:SetTarget(s.rmsptg)
42+
e2:SetOperation(s.rmspop)
43+
e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
44+
c:RegisterEffect(e2)
45+
end
46+
s.listed_names={101303005,101303006} --"Magnet Warrior Σ+", "Magnet Warrior Σ-"
47+
s.listed_series={SET_MAGNET_WARRIOR_SIGMA}
48+
function s.selfspcostfilter(c)
49+
return c:IsCode(101303005,101303006) and (c:IsFaceup() or not c:IsOnField()) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true,true)
50+
end
51+
function s.rescon(sg,e,tp,mg)
52+
return Duel.GetMZoneCount(tp,sg)>0 and sg:IsExists(Card.IsCode,1,nil,101303005) and sg:IsExists(Card.IsCode,1,nil,101303006)
53+
end
54+
function s.selfspcon(e,c)
55+
if c==nil then return true end
56+
local tp=e:GetHandlerPlayer()
57+
local g=Duel.GetMatchingGroup(s.selfspcostfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,nil)
58+
return #g>=2 and Duel.GetMZoneCount(tp,g)>0 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0)
59+
end
60+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
61+
local g=Duel.GetMatchingGroup(s.selfspcostfilter,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE,0,nil)
62+
local sg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_REMOVE,nil,nil,true)
63+
if #sg>0 then
64+
e:SetLabelObject(sg)
65+
return true
66+
end
67+
return false
68+
end
69+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c)
70+
local sg=e:GetLabelObject()
71+
if sg then
72+
Duel.Remove(sg,POS_FACEUP,REASON_COST)
73+
end
74+
end
75+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
76+
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end
77+
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
78+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
79+
local tc=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
80+
if tc:IsAttribute(ATTRIBUTE_EARTH) and tc:IsFaceup() then
81+
e:SetLabel(100)
82+
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,tc,1,tp,0)
83+
Duel.SetPossibleOperationInfo(0,CATEGORY_CONTROL,tc,1,tp,0)
84+
else
85+
e:SetLabel(0)
86+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,tp,0)
87+
end
88+
end
89+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
90+
local tc=Duel.GetFirstTarget()
91+
if not tc:IsRelateToEffect(e) then return end
92+
local earth_chk=e:GetLabel()==100
93+
if earth_chk and tc:IsControlerCanBeChanged() and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
94+
Duel.GetControl(tc,tp)
95+
else
96+
Duel.Destroy(tc,REASON_EFFECT)
97+
end
98+
end
99+
function s.rmspfilter(c,e,tp)
100+
return c:IsSetCard(SET_MAGNET_WARRIOR_SIGMA) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
101+
end
102+
function s.rmsptg(e,tp,eg,ep,ev,re,r,rp,chk)
103+
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>=2
104+
and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
105+
and Duel.IsExistingMatchingCard(s.rmspfilter,tp,LOCATION_REMOVED,0,2,nil,e,tp) end
106+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_REMOVED)
107+
end
108+
function s.rmspop(e,tp,eg,ep,ev,re,r,rp)
109+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
110+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
111+
local g=Duel.SelectMatchingCard(tp,s.rmspfilter,tp,LOCATION_REMOVED,0,2,2,nil,e,tp)
112+
if #g==2 then
113+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
114+
end
115+
end

pre-release/c101303005.lua

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
--磁石の戦士Σ+
2+
--Magnet Warrior Σ+
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--While you control an EARTH monster, your opponent's monsters that can attack must attack EARTH monsters
7+
local e1a=Effect.CreateEffect(c)
8+
e1a:SetType(EFFECT_TYPE_FIELD)
9+
e1a:SetCode(EFFECT_MUST_ATTACK)
10+
e1a:SetRange(LOCATION_MZONE)
11+
e1a:SetTargetRange(0,LOCATION_MZONE)
12+
e1a:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_EARTH),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end)
13+
c:RegisterEffect(e1a)
14+
local e1b=e1a:Clone()
15+
e1b:SetCode(EFFECT_MUST_ATTACK_MONSTER)
16+
e1b:SetValue(function(e,c) return c:IsAttribute(ATTRIBUTE_EARTH) end)
17+
c:RegisterEffect(e1b)
18+
--While your opponent controls an EARTH monster, you choose the attack targets for your opponent's attacks
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetType(EFFECT_TYPE_FIELD)
21+
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
22+
e2:SetCode(EFFECT_PATRICIAN_OF_DARKNESS)
23+
e2:SetRange(LOCATION_MZONE)
24+
e2:SetTargetRange(0,1)
25+
e2:SetCondition(function(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_EARTH),e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil) end)
26+
c:RegisterEffect(e2)
27+
--Add to your hand, or Special Summon, 1 Level 4 or lower "Magnet Warrior" monster in your GY, except "Magnet Warrior Σ+"
28+
local e3=Effect.CreateEffect(c)
29+
e3:SetDescription(aux.Stringid(id,0))
30+
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
31+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
32+
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
33+
e3:SetCode(EVENT_TO_GRAVE)
34+
e3:SetCountLimit(1,id)
35+
e3:SetTarget(s.thsptg)
36+
e3:SetOperation(s.thspop)
37+
c:RegisterEffect(e3)
38+
end
39+
s.listed_series={SET_MAGNET_WARRIOR}
40+
s.listed_names={id}
41+
function s.thspfilter(c,e,tp,mmz_chk)
42+
return c:IsLevelBelow(4) and c:IsSetCard(SET_MAGNET_WARRIOR) and not c:IsCode(id)
43+
and (c:IsAbleToHand() or (mmz_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
44+
end
45+
function s.thsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
46+
local mmz_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
47+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.thspfilter(chkc,e,tp,mmz_chk) end
48+
if chk==0 then return Duel.IsExistingTarget(s.thspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,mmz_chk) end
49+
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
50+
local g=Duel.SelectTarget(tp,s.thspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mmz_chk)
51+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0)
52+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
53+
end
54+
function s.thspop(e,tp,eg,ep,ev,re,r,rp)
55+
local tc=Duel.GetFirstTarget()
56+
if tc:IsRelateToEffect(e) then
57+
aux.ToHandOrElse(tc,tp,
58+
function()
59+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
60+
end,
61+
function()
62+
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
63+
end,
64+
aux.Stringid(id,2)
65+
)
66+
end
67+
end

pre-release/c101303006.lua

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
--磁石の戦士Σ-
2+
--Magnet Warrior Σ-
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Negate an attack involving 2 EARTH monsters
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
10+
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
11+
e1:SetRange(LOCATION_MZONE)
12+
e1:SetCountLimit(1)
13+
e1:SetCondition(s.atknegcon)
14+
e1:SetOperation(function() Duel.NegateAttack() end)
15+
c:RegisterEffect(e1)
16+
--Fusion Summon 1 Fusion Monster from your Extra Deck, using Rock monsters from your hand or field, including this card in your hand
17+
local fusion_params={
18+
handler=c,
19+
matfilter=function(c) return c:IsRace(RACE_ROCK) end,
20+
gc=Fusion.ForcedHandler
21+
}
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,1))
24+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
25+
e2:SetType(EFFECT_TYPE_IGNITION)
26+
e2:SetRange(LOCATION_HAND)
27+
e2:SetCountLimit(1,id)
28+
e2:SetCost(Cost.SelfReveal)
29+
e2:SetTarget(Fusion.SummonEffTG(fusion_params))
30+
e2:SetOperation(Fusion.SummonEffOP(fusion_params))
31+
c:RegisterEffect(e2)
32+
--Send 1 Level 8 "Magna Warrior" monster from your Deck to your GY
33+
local e3a=Effect.CreateEffect(c)
34+
e3a:SetDescription(aux.Stringid(id,2))
35+
e3a:SetCategory(CATEGORY_TOGRAVE)
36+
e3a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
37+
e3a:SetProperty(EFFECT_FLAG_DELAY)
38+
e3a:SetCode(EVENT_SUMMON_SUCCESS)
39+
e3a:SetCountLimit(1,{id,1})
40+
e3a:SetTarget(s.tgtg)
41+
e3a:SetOperation(s.tgop)
42+
c:RegisterEffect(e3a)
43+
local e3b=e3a:Clone()
44+
e3b:SetCode(EVENT_SPSUMMON_SUCCESS)
45+
c:RegisterEffect(e3b)
46+
end
47+
s.listed_series={SET_MAGNA_WARRIOR}
48+
function s.atknegcon(e,tp,eg,ep,ev,re,r,rp)
49+
local bc1=Duel.GetAttacker()
50+
local bc2=Duel.GetAttackTarget()
51+
return bc1:IsAttribute(ATTRIBUTE_EARTH) and bc2 and bc2:IsAttribute(ATTRIBUTE_EARTH) and bc2:IsFaceup()
52+
end
53+
function s.tgfilter(c)
54+
return c:IsLevel(8) and c:IsSetCard(SET_MAGNA_WARRIOR) and c:IsAbleToGrave()
55+
end
56+
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
57+
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
58+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
59+
end
60+
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
61+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
62+
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
63+
if #g>0 then
64+
Duel.SendtoGrave(g,REASON_EFFECT)
65+
end
66+
end

pre-release/c101303020.lua

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
--ビック・バイパー Type-L
2+
--Vic Viper Type-L
3+
--scripted by Naim
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_FIELD+EFFECT_TYPE_TRIGGER_O)
10+
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
11+
e1:SetRange(LOCATION_MZONE)
12+
e1:SetCountLimit(1,id)
13+
e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
14+
e1:SetTarget(s.efftg)
15+
e1:SetOperation(s.effop)
16+
c:RegisterEffect(e1)
17+
--Special Summon 1 LIGHT Machine monster from your GY
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
21+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
22+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
23+
e2:SetCode(EVENT_DESTROYED)
24+
e2:SetCountLimit(1,{id,1})
25+
e2:SetTarget(s.gysptg)
26+
e2:SetOperation(s.gyspop)
27+
c:RegisterEffect(e2)
28+
end
29+
function s.handspfilter(c,e,tp)
30+
return c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
31+
end
32+
function s.tgfilter(c)
33+
return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE) and c:IsAbleToGrave()
34+
end
35+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
36+
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
37+
and Duel.IsExistingMatchingCard(s.handspfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
38+
local b2=Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil)
39+
if chk==0 then return b1 or b2 end
40+
local op=Duel.SelectEffect(tp,
41+
{b1,aux.Stringid(id,2)},
42+
{b2,aux.Stringid(id,3)})
43+
e:SetLabel(op)
44+
if op==1 then
45+
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
46+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
47+
elseif op==2 then
48+
e:SetCategory(CATEGORY_TOGRAVE)
49+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
50+
end
51+
end
52+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
53+
local op=e:GetLabel()
54+
if op==1 then
55+
--Special Summon 1 Machine monster from your hand
56+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
57+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
58+
local g=Duel.SelectMatchingCard(tp,s.handspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
59+
if #g>0 then
60+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
61+
end
62+
elseif op==2 then
63+
--Send 1 Level 4 or lower LIGHT Machine monster from your Deck to the GY
64+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
65+
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
66+
if #g>0 then
67+
Duel.SendtoGrave(g,REASON_EFFECT)
68+
end
69+
end
70+
end
71+
function s.gyspfilter(c,e,tp)
72+
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
73+
end
74+
function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
75+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.gyspfilter(chkc,e,tp) end
76+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
77+
and Duel.IsExistingTarget(s.gyspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
78+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
79+
local tc=Duel.SelectTarget(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
80+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,tp,0)
81+
if tc:GetBaseAttack()<=1200 then
82+
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,tc,1,tp,1200)
83+
end
84+
end
85+
function s.gyspop(e,tp,eg,ep,ev,re,r,rp)
86+
local tc=Duel.GetFirstTarget()
87+
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and tc:GetBaseAttack()<=1200 then
88+
--If its original ATK is 1200 or less, it gains 1200 ATK
89+
local e1=Effect.CreateEffect(e:GetHandler())
90+
e1:SetType(EFFECT_TYPE_SINGLE)
91+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
92+
e1:SetCode(EFFECT_UPDATE_ATTACK)
93+
e1:SetValue(1200)
94+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
95+
tc:RegisterEffect(e1)
96+
end
97+
end

0 commit comments

Comments
 (0)