Skip to content

Commit 9e3a60d

Browse files
authored
Added new card scripts
1 parent 4d70a32 commit 9e3a60d

File tree

2 files changed

+148
-0
lines changed

2 files changed

+148
-0
lines changed

pre-release/c100419001.lua

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
--ドラゴンメイド・シュテルン
2+
--Dragonmaid Stern
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Dragon Fusion Monsters you control cannot be destroyed by your opponent's card effects
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetType(EFFECT_TYPE_FIELD)
9+
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
10+
e1:SetRange(LOCATION_MZONE)
11+
e1:SetTargetRange(LOCATION_MZONE,0)
12+
e1:SetTarget(function(e,c) return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_FUSION) end)
13+
e1:SetValue(aux.indoval)
14+
c:RegisterEffect(e1)
15+
--Special Summon 1 "Dragonmaid" monster from your GY or banishment, except "Dragonmaid Stern"
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,0))
18+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
19+
e2:SetType(EFFECT_TYPE_IGNITION)
20+
e2:SetRange(LOCATION_HAND)
21+
e2:SetCountLimit(1,id)
22+
e2:SetCost(aux.SelfDiscardCost)
23+
e2:SetTarget(s.gyrmsptg)
24+
e2:SetOperation(s.gyrmspop)
25+
c:RegisterEffect(e2)
26+
--Return this card to the hand, and if you do, Special Summon 1 Level 4 or lower "Dragonmaid" monster from your hand
27+
local e3=Effect.CreateEffect(c)
28+
e3:SetDescription(aux.Stringid(id,1))
29+
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
30+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
31+
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
32+
e3:SetRange(LOCATION_MZONE)
33+
e3:SetCountLimit(1,{id,1})
34+
e3:SetTarget(s.thtg)
35+
e3:SetOperation(s.thop)
36+
c:RegisterEffect(e3)
37+
end
38+
s.listed_series={SET_DRAGONMAID}
39+
s.listed_names={id}
40+
function s.gyrmspfilter(c,e,tp)
41+
return c:IsSetCard(SET_DRAGONMAID) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup() and not c:IsCode(id)
42+
end
43+
function s.gyrmsptg(e,tp,eg,ep,ev,re,r,rp,chk)
44+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
45+
and Duel.IsExistingMatchingCard(s.gyrmspfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end
46+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED)
47+
end
48+
function s.gyrmspop(e,tp,eg,ep,ev,re,r,rp)
49+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
50+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
51+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.gyrmspfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp)
52+
if #g>0 then
53+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
54+
end
55+
end
56+
function s.handspfilter(c,e,tp)
57+
return c:IsLevelBelow(4) and c:IsSetCard(SET_DRAGONMAID) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
58+
end
59+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
60+
local c=e:GetHandler()
61+
if chk==0 then return Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToHand()
62+
and Duel.IsExistingMatchingCard(s.handspfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
63+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0)
64+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
65+
end
66+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
67+
local c=e:GetHandler()
68+
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)>0 and c:IsLocation(LOCATION_HAND)
69+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
70+
Duel.ShuffleHand(tp)
71+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
72+
local g=Duel.SelectMatchingCard(tp,s.handspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
73+
if #g>0 then
74+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
75+
end
76+
end
77+
end

pre-release/c100419002.lua

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
--ドラゴンメイド・ラティス
2+
--Lady's Dragonmaid
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 2 "Dragonmaid" monsters with the same Attribute but different Levels
8+
Fusion.AddProcMixN(c,true,true,s.matfilter,2)
9+
Fusion.AddContactProc(c,s.contactfil,function(g) Duel.Remove(g,POS_FACEUP,REASON_COST|REASON_MATERIAL) end,function(e) return not e:GetHandler():IsLocation(LOCATION_EXTRA) end)
10+
--Special Summon 1 Level 4 or lower "Dragonmaid" monster from your Deck
11+
local e1=Effect.CreateEffect(c)
12+
e1:SetDescription(aux.Stringid(id,0))
13+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
14+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
15+
e1:SetProperty(EFFECT_FLAG_DELAY)
16+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
17+
e1:SetCountLimit(1,id)
18+
e1:SetTarget(s.sptg)
19+
e1:SetOperation(s.spop)
20+
c:RegisterEffect(e1)
21+
--Fusion Summon 1 Dragon Fusion Monster from your Extra Deck, by shuffling its materials from your field and/or banishment into the Deck
22+
local params={fusfilter=aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),
23+
matfilter=aux.FALSE,
24+
extrafil=s.fextra,
25+
extraop=Fusion.ShuffleMaterial,
26+
extratg=s.extratg}
27+
local e2=Effect.CreateEffect(c)
28+
e2:SetDescription(aux.Stringid(id,1))
29+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
30+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
31+
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
32+
e2:SetRange(LOCATION_MZONE)
33+
e2:SetCountLimit(1,{id,1})
34+
e2:SetTarget(Fusion.SummonEffTG(params))
35+
e2:SetOperation(Fusion.SummonEffOP(params))
36+
c:RegisterEffect(e2)
37+
end
38+
s.listed_series={SET_DRAGONMAID}
39+
function s.matfilter(c,fc,sumtype,sp,sub,mg,sg)
40+
return c:IsSetCard(SET_DRAGONMAID,fc,sumtype,sp) and (not sg or sg:FilterCount(aux.TRUE,c)==0 or (sg:IsExists(Card.IsAttribute,1,c,c:GetAttribute(),fc,sumtype,sp) and not sg:IsExists(Card.IsLevel,1,c,c:GetLevel()) and not sg:IsExists(Card.IsLocation,1,c,c:GetLocation())))
41+
end
42+
function s.contactfil(tp)
43+
if Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then return false end
44+
return Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil)
45+
end
46+
function s.spfilter(c,e,tp)
47+
return c:IsLevelBelow(4) and c:IsSetCard(SET_DRAGONMAID) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
48+
end
49+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
50+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
51+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
52+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
53+
end
54+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
55+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
56+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
57+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
58+
if #g>0 then
59+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
60+
end
61+
end
62+
function s.fextrafil(c)
63+
return c:IsAbleToDeck() and (c:IsOnField() or c:IsFaceup())
64+
end
65+
function s.fextra(e,tp,mg)
66+
return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(s.fextrafil),tp,LOCATION_ONFIELD|LOCATION_REMOVED,0,nil)
67+
end
68+
function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk)
69+
if chk==0 then return true end
70+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,LOCATION_ONFIELD|LOCATION_REMOVED)
71+
end

0 commit comments

Comments
 (0)