Skip to content

Commit 43904d6

Browse files
authored
Added new card scripts
1 parent e4cb78f commit 43904d6

File tree

2 files changed

+189
-0
lines changed

2 files changed

+189
-0
lines changed

pre-release/c101304027.lua

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
--血樹竜姫ドラセレア
2+
--Draselea the Blood Tree Dragon Princess
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--You can send 1 Level 4 or lower Plant monster from your Deck to the GY, except "Draselea the Blood Tree Dragon Princess"; Special Summon this card from your hand, and if you do, its Level becomes the sent monster's
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:SetCost(Cost.AND(s.selfspcost,s.effcost))
14+
e1:SetTarget(s.selfsptg)
15+
e1:SetOperation(s.selfspop)
16+
c:RegisterEffect(e1)
17+
--You can banish this card and 1 Plant monster from your GY; Special Summon 1 Dragon monster from your hand or GY
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetRange(LOCATION_GRAVE)
23+
e2:SetCountLimit(1,{id,1})
24+
e2:SetCost(Cost.AND(s.dragonspcost,s.effcost))
25+
e2:SetTarget(s.dragonsptg)
26+
e2:SetOperation(s.dragonspop)
27+
c:RegisterEffect(e2)
28+
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return c:IsRace(RACE_DRAGON|RACE_PLANT) end)
29+
end
30+
s.listed_names={id}
31+
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
32+
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
33+
--You cannot Special Summon the turn you activate either of this card's effects, except Dragon or Plant monsters
34+
local e1=Effect.CreateEffect(e:GetHandler())
35+
e1:SetDescription(aux.Stringid(id,2))
36+
e1:SetType(EFFECT_TYPE_FIELD)
37+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
38+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
39+
e1:SetTargetRange(1,0)
40+
e1:SetTarget(function(e,c) return c:IsRaceExcept(RACE_DRAGON|RACE_PLANT) end)
41+
e1:SetReset(RESET_PHASE|PHASE_END)
42+
Duel.RegisterEffect(e1,tp)
43+
end
44+
function s.selfspcostfilter(c)
45+
return c:IsLevelBelow(4) and c:IsRace(RACE_PLANT) and not c:IsCode(id) and c:IsAbleToGraveAsCost()
46+
end
47+
function s.selfspcost(e,tp,eg,ep,ev,re,r,rp,chk)
48+
if chk==0 then return Duel.IsExistingMatchingCard(s.selfspcostfilter,tp,LOCATION_DECK,0,1,nil) end
49+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
50+
local sc=Duel.SelectMatchingCard(tp,s.selfspcostfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
51+
Duel.SendtoGrave(sc,REASON_COST)
52+
e:SetLabel(sc:GetLevel())
53+
end
54+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
55+
local c=e:GetHandler()
56+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
57+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
58+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
59+
end
60+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
61+
local c=e:GetHandler()
62+
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
63+
--Its Level becomes the sent monster's
64+
local e1=Effect.CreateEffect(c)
65+
e1:SetType(EFFECT_TYPE_SINGLE)
66+
e1:SetCode(EFFECT_CHANGE_LEVEL)
67+
e1:SetValue(e:GetLabel())
68+
e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE)
69+
c:RegisterEffect(e1)
70+
end
71+
Duel.SpecialSummonComplete()
72+
end
73+
function s.dragonspcostfilter(c,e,tp,handler)
74+
return c:IsRace(RACE_PLANT) and c:IsAbleToRemoveAsCost()
75+
and Duel.IsExistingMatchingCard(s.dragonspfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,Group.FromCards(c,handler),e,tp)
76+
end
77+
function s.dragonspfilter(c,e,tp)
78+
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
79+
end
80+
function s.dragonspcost(e,tp,eg,ep,ev,re,r,rp,chk)
81+
local c=e:GetHandler()
82+
if chk==0 then return c:IsAbleToRemoveAsCost()
83+
and Duel.IsExistingMatchingCard(s.dragonspcostfilter,tp,LOCATION_GRAVE,0,1,c,e,tp,c) end
84+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
85+
local g=Duel.SelectMatchingCard(tp,s.dragonspcostfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp,c)
86+
Duel.Remove(g+c,POS_FACEUP,REASON_COST)
87+
end
88+
function s.dragonsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
89+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
90+
and Duel.IsExistingMatchingCard(s.dragonspfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end
91+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE)
92+
end
93+
function s.dragonspop(e,tp,eg,ep,ev,re,r,rp)
94+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
95+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
96+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.dragonspfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp)
97+
if #g>0 then
98+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
99+
end
100+
end

pre-release/c101304049.lua

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
--ブリーチヴァレル・ドラゴン
2+
--Breechborrel Dragon
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Link Summon procedure: 2 DARK Dragon monsters, including a "Rokket" monster
8+
Link.AddProcedure(c,s.matfilter,2,nil,s.matcheck)
9+
--If this card is Link Summoned: You can add 1 "Borrel" Spell/Trap from your Deck to your hand
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
13+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
14+
e1:SetProperty(EFFECT_FLAG_DELAY)
15+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
16+
e1:SetCountLimit(1,{id,0})
17+
e1:SetCondition(function(e) return e:GetHandler():IsLinkSummoned() end)
18+
e1:SetTarget(s.thtg)
19+
e1:SetOperation(s.thop)
20+
c:RegisterEffect(e1)
21+
--(Quick Effect): You can target 1 DARK monster you control; it gains 500 ATK, or if that monster is no longer on the field, you can Special Summon 1 "Rokket" monster from your Deck in Defense Position instead
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,1))
24+
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SPECIAL_SUMMON)
25+
e2:SetType(EFFECT_TYPE_QUICK_O)
26+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
27+
e2:SetCode(EVENT_FREE_CHAIN)
28+
e2:SetRange(LOCATION_MZONE)
29+
e2:SetCountLimit(1,{id,1})
30+
e2:SetCondition(aux.StatChangeDamageStepCondition)
31+
e2:SetTarget(s.atktg)
32+
e2:SetOperation(s.atkop)
33+
e2:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
34+
c:RegisterEffect(e2)
35+
end
36+
s.listed_series={SET_BORREL,SET_ROKKET}
37+
function s.matfilter(c,linkc,st,tp)
38+
return c:IsAttribute(ATTRIBUTE_DARK,linkc,st,tp) and c:IsRace(RACE_DRAGON,linkc,st,tp)
39+
end
40+
function s.matcheck(g,linkc,sumtype,tp)
41+
return g:IsExists(Card.IsSetCard,1,nil,SET_ROKKET,linkc,sumtype,tp)
42+
end
43+
function s.thfilter(c)
44+
return c:IsSetCard(SET_BORREL) and c:IsSpellTrap() and c:IsAbleToHand()
45+
end
46+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
47+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
48+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
49+
end
50+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
51+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
52+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
53+
if #g>0 then
54+
Duel.SendtoHand(g,nil,REASON_EFFECT)
55+
Duel.ConfirmCards(1-tp,g)
56+
end
57+
end
58+
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
59+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsAttribute(ATTRIBUTE_DARK) and chkc:IsFaceup() end
60+
if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_DARK),tp,LOCATION_MZONE,0,1,nil) end
61+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF)
62+
Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_DARK),tp,LOCATION_MZONE,0,1,1,nil)
63+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
64+
end
65+
function s.spfilter(c,e,tp)
66+
return c:IsSetCard(SET_ROKKET) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
67+
end
68+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
69+
local tc=Duel.GetFirstTarget()
70+
if tc:IsRelateToEffect(e) then
71+
if tc:IsFacedown() then return end
72+
--It gains 500 ATK
73+
local e1=Effect.CreateEffect(e:GetHandler())
74+
e1:SetType(EFFECT_TYPE_SINGLE)
75+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
76+
e1:SetCode(EFFECT_UPDATE_ATTACK)
77+
e1:SetValue(500)
78+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
79+
tc:RegisterEffect(e1)
80+
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)>0
81+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
82+
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
83+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
84+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
85+
if #g>0 then
86+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
87+
end
88+
end
89+
end

0 commit comments

Comments
 (0)