Skip to content

Commit 2ef856f

Browse files
authored
Added new card scripts
1 parent 6f739e7 commit 2ef856f

File tree

3 files changed

+246
-0
lines changed

3 files changed

+246
-0
lines changed

pre-release/c101304025.lua

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
--妖光のディアーブロッケン
2+
--Diabrocken of the Ghost Light
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--(Quick Effect): You can banish 1 FIRE monster from your face-up field or GY; 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)
10+
e1:SetType(EFFECT_TYPE_QUICK_O)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,{id,0})
14+
e1:SetCost(s.spcost)
15+
e1:SetTarget(s.sptg)
16+
e1:SetOperation(s.spop)
17+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
18+
c:RegisterEffect(e1)
19+
--If this card is Special Summoned: You can target 1 face-up card on the field; negate its effects until the end of this turn
20+
local e2=Effect.CreateEffect(c)
21+
e2:SetDescription(aux.Stringid(id,1))
22+
e2:SetCategory(CATEGORY_DISABLE)
23+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
24+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
25+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
26+
e2:SetCountLimit(1,{id,1})
27+
e2:SetTarget(s.distg)
28+
e2:SetOperation(s.disop)
29+
c:RegisterEffect(e2)
30+
--If this card is sent to the GY as Link Material: You can Set 1 Quick-Play Spell or Normal Trap from your GY that was sent there this turn
31+
local e3=Effect.CreateEffect(c)
32+
e3:SetDescription(aux.Stringid(id,2))
33+
e3:SetCategory(CATEGORY_LEAVE_GRAVE)
34+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
35+
e3:SetProperty(EFFECT_FLAG_DELAY)
36+
e3:SetCode(EVENT_BE_MATERIAL)
37+
e3:SetCountLimit(1,{id,2})
38+
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_LINK end)
39+
e3:SetTarget(s.settg)
40+
e3:SetOperation(s.setop)
41+
c:RegisterEffect(e3)
42+
end
43+
function s.spcostfilter(c,tp)
44+
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup() and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
45+
end
46+
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
47+
if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil,tp) end
48+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
49+
local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil,tp)
50+
Duel.Remove(g,POS_FACEUP,REASON_COST)
51+
end
52+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
53+
local c=e:GetHandler()
54+
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
55+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
56+
end
57+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
58+
local c=e:GetHandler()
59+
if c:IsRelateToEffect(e) then
60+
Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)
61+
end
62+
end
63+
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
64+
if chkc then return chkc:IsOnField() and chkc:IsNegatable() end
65+
if chk==0 then return Duel.IsExistingTarget(Card.IsNegatable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
66+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
67+
local g=Duel.SelectTarget(tp,Card.IsNegatable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
68+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,tp,0)
69+
end
70+
function s.disop(e,tp,eg,ep,ev,re,r,rp,chk)
71+
local tc=Duel.GetFirstTarget()
72+
if tc:IsRelateToEffect(e) then
73+
tc:NegateEffects(e:GetHandler(),RESET_PHASE|PHASE_END)
74+
end
75+
end
76+
function s.setfilter(c,turn_count)
77+
return (c:IsQuickPlaySpell() or c:IsNormalTrap()) and c:GetTurnID()==turn_count and c:IsSSetable()
78+
end
79+
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
80+
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_GRAVE,0,1,nil,Duel.GetTurnCount()) end
81+
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
82+
end
83+
function s.setop(e,tp,eg,ep,ev,re,r,rp)
84+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
85+
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil,Duel.GetTurnCount())
86+
if #g>0 then
87+
Duel.SSet(tp,g)
88+
end
89+
end

pre-release/c101304026.lua

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
--コンベックス・ナイト
2+
--Convex Knight
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If a Machine monster is on the field and this card is in your hand: You can Special Summon this card in Defense Position, then you can make its Level become equal to the Level/Rank of 1 Machine monster on the field
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_LVCHANGE)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetRange(LOCATION_HAND)
12+
e1:SetCountLimit(1,{id,0})
13+
e1:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_MACHINE),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end)
14+
e1:SetTarget(s.sptg)
15+
e1:SetOperation(s.spop)
16+
c:RegisterEffect(e1)
17+
--During your Main Phase: You can send 1 EARTH Machine monster from your Deck to the GY, then this card gains ATK equal to the sent monster's Level x 100 until the end of this turn
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetRange(LOCATION_MZONE)
23+
e2:SetCountLimit(1,{id,1})
24+
e2:SetTarget(s.tgtg)
25+
e2:SetOperation(s.tgop)
26+
c:RegisterEffect(e2)
27+
end
28+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
29+
local c=e:GetHandler()
30+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
31+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
32+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
33+
Duel.SetPossibleOperationInfo(0,CATEGORY_LVCHANGE,c,1,tp,0)
34+
end
35+
function s.lvfilter(c,lv)
36+
return ((c:HasLevel() and not c:IsLevel(lv)) or (c:HasRank() and not c:IsRank(lv)))
37+
and c:IsRace(RACE_MACHINE) and c:IsFaceup()
38+
end
39+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
40+
local c=e:GetHandler()
41+
local lv=c:GetLevel()
42+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0
43+
and Duel.IsExistingMatchingCard(s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,lv)
44+
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
45+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
46+
local sc=Duel.SelectMatchingCard(tp,s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,lv):GetFirst()
47+
if not sc then return end
48+
Duel.HintSelection(sc)
49+
local lv_rnk=(sc:HasLevel() and sc:GetLevel())
50+
or (sc:HasRank() and sc:GetRank())
51+
Duel.BreakEffect()
52+
--Make its Level become equal to the Level/Rank of 1 Machine monster on the field
53+
local e1=Effect.CreateEffect(c)
54+
e1:SetType(EFFECT_TYPE_SINGLE)
55+
e1:SetCode(EFFECT_CHANGE_LEVEL)
56+
e1:SetValue(lv_rnk)
57+
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
58+
c:RegisterEffect(e1)
59+
end
60+
end
61+
function s.tgfilter(c)
62+
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE) and c:IsAbleToGrave()
63+
end
64+
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
65+
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
66+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
67+
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,c,1,tp,0)
68+
end
69+
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
70+
local c=e:GetHandler()
71+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
72+
local sc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
73+
if sc and Duel.SendtoGrave(sc,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_GRAVE)
74+
and c:IsRelateToEffect(e) and c:IsFaceup() then
75+
Duel.BreakEffect()
76+
--This card gains ATK equal to the sent monster's Level x 100 until the end of this turn
77+
c:UpdateAttack(sc:GetLevel()*100,RESETS_STANDARD_DISABLE_PHASE_END)
78+
end
79+
end

pre-release/c101304076.lua

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--ノーザンクロスファイア
2+
--Northern Cross Fire
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--If the total Levels of monsters you control are 10 or higher: Take 1 Level 10 monster from your hand or Deck, and either add it to your hand or Special Summon it
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCountLimit(1,id)
13+
e1:SetCondition(function(e,tp) return Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetSum(Card.GetLevel)>=10 end)
14+
e1:SetTarget(s.target)
15+
e1:SetOperation(s.activate)
16+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
17+
c:RegisterEffect(e1)
18+
--If the total Levels of monsters your opponent controls are 10 or higher: You can banish this card and 1 Level 10 monster from your GY, then target 1 card your opponent controls; banish it
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
21+
e2:SetCategory(CATEGORY_REMOVE)
22+
e2:SetType(EFFECT_TYPE_QUICK_O)
23+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
24+
e2:SetCode(EVENT_FREE_CHAIN)
25+
e2:SetRange(LOCATION_GRAVE)
26+
e2:SetCountLimit(1,id)
27+
e2:SetCondition(function(e,tp) return Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil):GetSum(Card.GetLevel)>=10 end)
28+
e2:SetCost(s.bancost)
29+
e2:SetTarget(s.bantg)
30+
e2:SetOperation(s.banop)
31+
e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
32+
c:RegisterEffect(e2)
33+
end
34+
function s.thspfilter(c,e,tp,sp_chk)
35+
return c:IsLevel(10) and (c:IsAbleToHand() or (sp_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
36+
end
37+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
38+
if chk==0 then
39+
local sp_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
40+
return Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp,sp_chk)
41+
end
42+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
43+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
44+
end
45+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
46+
local sp_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
47+
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2))
48+
local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp,sp_chk):GetFirst()
49+
if not sc then return end
50+
aux.ToHandOrElse(sc,tp,
51+
function() return sp_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end,
52+
function() Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end,
53+
aux.Stringid(id,3)
54+
)
55+
end
56+
function s.bancostfilter(c)
57+
return c:IsLevel(10) and c:IsAbleToRemoveAsCost()
58+
end
59+
function s.bancost(e,tp,eg,ep,ev,re,r,rp,chk)
60+
local c=e:GetHandler()
61+
if chk==0 then return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(s.bancostfilter,tp,LOCATION_GRAVE,0,1,c) end
62+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
63+
local g=Duel.SelectMatchingCard(tp,s.bancostfilter,tp,LOCATION_GRAVE,0,1,1,c)
64+
Duel.Remove(g+c,POS_FACEUP,REASON_COST)
65+
end
66+
function s.bantg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
67+
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
68+
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
69+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
70+
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
71+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0)
72+
end
73+
function s.banop(e,tp,eg,ep,ev,re,r,rp)
74+
local tc=Duel.GetFirstTarget()
75+
if tc:IsRelateToEffect(e) then
76+
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
77+
end
78+
end

0 commit comments

Comments
 (0)