Skip to content

Commit 8da0c2d

Browse files
authored
Added new card scripts
1 parent b149582 commit 8da0c2d

File tree

7 files changed

+613
-0
lines changed

7 files changed

+613
-0
lines changed

pre-release/c100447062.lua

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
--影雄の烬 エグリスタ
2+
--Tohushaddoll Grysta
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Apply the effect of 1 non-Rock "Shaddoll" monster in your GY that activates when it is flipped face-up
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
10+
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
11+
e1:SetCountLimit(1,id)
12+
e1:SetTarget(s.applytg)
13+
e1:SetOperation(s.applyop)
14+
c:RegisterEffect(e1)
15+
--Fusion Summon 1 "Shaddoll" Fusion Monster from your Extra Deck, by banishing its materials from your hand, field, and/or GY
16+
local fusion_params={
17+
fusfilter=function(c) return c:IsSetCard(SET_SHADDOLL) end,
18+
matfilter=Card.IsAbleToRemove,
19+
extrafil=s.fextra,
20+
extraop=Fusion.BanishMaterial,
21+
extratg=s.extratg}
22+
local e2=Effect.CreateEffect(c)
23+
e2:SetDescription(aux.Stringid(id,1))
24+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_REMOVE)
25+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
26+
e2:SetProperty(EFFECT_FLAG_DELAY)
27+
e2:SetCode(EVENT_TO_GRAVE)
28+
e2:SetCountLimit(1,id)
29+
e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_EFFECT) and not Duel.IsPhase(PHASE_DAMAGE) end)
30+
e2:SetCost(s.fusioncost)
31+
e2:SetTarget(Fusion.SummonEffTG(fusion_params))
32+
e2:SetOperation(Fusion.SummonEffOP(fusion_params))
33+
c:RegisterEffect(e2)
34+
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsSetCard(SET_SHADDOLL) end)
35+
end
36+
s.listed_series={SET_SHADDOLL}
37+
function s.applyfilter(c,e,tp)
38+
if not (not c:IsRace(RACE_ROCK) and c:IsSetCard(SET_SHADDOLL) and c:IsMonster()) then return false end
39+
local effs={c:GetOwnEffects()}
40+
for _,eff in ipairs(effs) do
41+
if eff:GetType()&EFFECT_TYPE_FLIP>0 or eff:GetCode()==EVENT_FLIP then
42+
local tg=eff:GetTarget()
43+
if tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0) then
44+
return true
45+
end
46+
end
47+
end
48+
return false
49+
end
50+
function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
51+
if chkc then return false end
52+
if chk==0 then return Duel.IsExistingTarget(s.applyfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
53+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
54+
local tc=Duel.SelectTarget(tp,s.applyfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
55+
local available_effs={}
56+
local effs={tc:GetOwnEffects()}
57+
for _,eff in ipairs(effs) do
58+
if eff:GetType()&EFFECT_TYPE_FLIP>0 or eff:GetCode()==EVENT_FLIP then
59+
local tg=eff:GetTarget()
60+
if tg==nil or tg(eff,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE,0) then
61+
table.insert(available_effs,eff)
62+
end
63+
end
64+
end
65+
local eff=nil
66+
if #available_effs>1 then
67+
local available_effs_desc={}
68+
for _,eff in ipairs(available_effs) do
69+
table.insert(available_effs_desc,eff:GetDescription())
70+
end
71+
local op=Duel.SelectOption(tp,table.unpack(available_effs_desc))
72+
eff=available_effs[op+1]
73+
else
74+
eff=available_effs[1]
75+
end
76+
Duel.Hint(HINT_OPSELECTED,1-tp,eff:GetDescription())
77+
Duel.ClearTargetCard()
78+
tc:CreateEffectRelation(e)
79+
e:SetLabel(eff:GetLabel())
80+
e:SetLabelObject(eff:GetLabelObject())
81+
local tg=eff:GetTarget()
82+
if tg then
83+
tg(e,tp,eg,ep,ev,re,r,rp,1)
84+
eff:SetLabel(e:GetLabel())
85+
eff:SetLabelObject(e:GetLabelObject())
86+
end
87+
e:SetLabelObject(eff)
88+
Duel.ClearOperationInfo(0)
89+
end
90+
function s.applyop(e,tp,eg,ep,ev,re,r,rp)
91+
local eff=e:GetLabelObject()
92+
if not (eff and eff:GetHandler():IsRelateToEffect(e)) then return end
93+
e:SetLabel(eff:GetLabel())
94+
e:SetLabelObject(eff:GetLabelObject())
95+
local op=eff:GetOperation()
96+
if op then
97+
op(e,tp,Group.CreateGroup(),PLAYER_NONE,0,e,REASON_EFFECT,PLAYER_NONE)
98+
end
99+
e:SetLabel(0)
100+
e:SetLabelObject(nil)
101+
end
102+
function s.fusioncost(e,tp,eg,ep,ev,re,r,rp,chk)
103+
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
104+
--You cannot Special Summon from the Extra Deck the turn you activate this effect, except "Shaddoll" monsters
105+
local e1=Effect.CreateEffect(e:GetHandler())
106+
e1:SetDescription(aux.Stringid(id,2))
107+
e1:SetType(EFFECT_TYPE_FIELD)
108+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
109+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
110+
e1:SetTargetRange(1,0)
111+
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(SET_SHADDOLL) end)
112+
e1:SetReset(RESET_PHASE|PHASE_END)
113+
Duel.RegisterEffect(e1,tp)
114+
end
115+
function s.fextra(e,tp,mg)
116+
if not Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then
117+
return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil)
118+
end
119+
return nil
120+
end
121+
function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk)
122+
if chk==0 then return true end
123+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE)
124+
end

pre-release/c100447063.lua

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
--エルシャドール・メシャフレール
2+
--El Shaddoll Meshahrail
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 1 "Shaddoll" monster + 1 DARK monster + 1 EARTH monster
8+
Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_SHADDOLL),s.matfilter(ATTRIBUTE_DARK),s.matfilter(ATTRIBUTE_EARTH))
9+
c:AddMustBeFusionSummoned()
10+
--Unaffected by your opponent's activated Spell/Trap effects and by activated effects from opponent's monsters whose original Level/Rank is lower than this card's current Level
11+
local e1=Effect.CreateEffect(c)
12+
e1:SetType(EFFECT_TYPE_SINGLE)
13+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
14+
e1:SetCode(EFFECT_IMMUNE_EFFECT)
15+
e1:SetRange(LOCATION_MZONE)
16+
e1:SetValue(s.immval)
17+
c:RegisterEffect(e1)
18+
--Add 1 "Shaddoll" card or "Void" Spell/Trap from your Deck to your hand
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,0))
21+
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
22+
e2:SetType(EFFECT_TYPE_IGNITION)
23+
e2:SetRange(LOCATION_MZONE)
24+
e2:SetCountLimit(1)
25+
e2:SetCost(Cost.PayLP(800))
26+
e2:SetTarget(s.thtg)
27+
e2:SetOperation(s.thop)
28+
c:RegisterEffect(e2)
29+
--Special Summon 1 "Shaddoll" monster from your GY
30+
local e3=Effect.CreateEffect(c)
31+
e3:SetDescription(aux.Stringid(id,1))
32+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
33+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
34+
e3:SetProperty(EFFECT_FLAG_DELAY)
35+
e3:SetCode(EVENT_TO_GRAVE)
36+
e3:SetTarget(s.sptg)
37+
e3:SetOperation(s.spop)
38+
c:RegisterEffect(e3)
39+
end
40+
s.listed_series={SET_SHADDOLL,SET_VOID}
41+
s.material_setcode=SET_SHADDOLL
42+
function s.matfilter(attribute)
43+
return function(c,fc,sumtype,tp)
44+
return c:IsAttribute(attribute,fc,sumtype,tp) or c:IsHasEffect(4904633)
45+
end
46+
end
47+
function s.immval(e,te)
48+
if not (te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsActivated()) then return false end
49+
if te:IsSpellTrapEffect() then return true end
50+
local tc=te:GetHandler()
51+
local lv=e:GetHandler():GetLevel()
52+
if tc:HasLevel() then
53+
return tc:GetOriginalLevel()<lv
54+
elseif tc:HasRank() then
55+
return tc:GetOriginalRank()<lv
56+
end
57+
return false
58+
end
59+
function s.thfilter(c)
60+
return (c:IsSetCard(SET_SHADDOLL) or (c:IsSetCard(SET_VOID) and c:IsSpellTrap())) and c:IsAbleToHand()
61+
end
62+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
63+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
64+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
65+
end
66+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
67+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
68+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
69+
if #g>0 then
70+
Duel.SendtoHand(g,nil,REASON_EFFECT)
71+
Duel.ConfirmCards(1-tp,g)
72+
end
73+
end
74+
function s.spfilter(c,e,tp)
75+
return c:IsSetCard(SET_SHADDOLL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
76+
end
77+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
78+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
79+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
80+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
81+
end
82+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
83+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
84+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
85+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
86+
if #g>0 then
87+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
88+
end
89+
end

pre-release/c100447066.lua

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
--煉獄の乖放
2+
--Void Liberation
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Add 2 "Shaddoll" cards from your Deck to your hand of different types (Monster, Spell, or Trap) from the revealed card and each other, then discard 1 card
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCountLimit(1,{id,0})
13+
e1:SetCost(Cost.Reveal(s.revealfilter,true,1,1,function(e,tp,g) e:SetLabel(g:GetFirst():GetMainCardType()) end))
14+
e1:SetTarget(s.shaddollthtg)
15+
e1:SetOperation(s.shaddollthop)
16+
c:RegisterEffect(e1)
17+
--Add 1 "Infernoid" monster from your Deck or GY your hand
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetRange(LOCATION_GRAVE)
23+
e2:SetCountLimit(1,{id,1})
24+
e2:SetCost(Cost.SelfBanish)
25+
e2:SetTarget(s.infernoidthtg)
26+
e2:SetOperation(s.infernoidthop)
27+
c:RegisterEffect(e2)
28+
end
29+
s.listed_series={SET_SHADDOLL,SET_INFERNOID}
30+
function s.revealfilter(c,e,tp)
31+
return c:IsSetCard(SET_SHADDOLL) and not c:IsPublic()
32+
and Duel.GetMatchingGroup(s.shaddollthfilter,tp,LOCATION_DECK,0,nil,c:GetMainCardType()):GetClassCount(Card.GetMainCardType)==2
33+
end
34+
function s.shaddollthfilter(c,main_type)
35+
return c:IsSetCard(SET_SHADDOLL) and c:IsAbleToHand() and not c:IsType(main_type)
36+
end
37+
function s.shaddollthtg(e,tp,eg,ep,ev,re,r,rp,chk)
38+
if chk==0 then return true end
39+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
40+
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
41+
end
42+
function s.shaddollthop(e,tp,eg,ep,ev,re,r,rp)
43+
local g=Duel.GetMatchingGroup(s.shaddollthfilter,tp,LOCATION_DECK,0,nil,e:GetLabel())
44+
if #g<2 then return end
45+
local sg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetMainCardType),1,tp,HINTMSG_ATOHAND)
46+
if #sg==2 and Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then
47+
Duel.ConfirmCards(1-tp,sg)
48+
Duel.ShuffleHand(tp)
49+
Duel.BreakEffect()
50+
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD,nil)
51+
end
52+
end
53+
function s.infernoidthfilter(c)
54+
return c:IsSetCard(SET_INFERNOID) and c:IsMonster() and c:IsAbleToHand()
55+
end
56+
function s.infernoidthtg(e,tp,eg,ep,ev,re,r,rp,chk)
57+
if chk==0 then return Duel.IsExistingMatchingCard(s.infernoidthfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,e:GetHandler()) end
58+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE)
59+
end
60+
function s.infernoidthop(e,tp,eg,ep,ev,re,r,rp)
61+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
62+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.infernoidthfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil)
63+
if #g>0 then
64+
Duel.SendtoHand(g,nil,REASON_EFFECT)
65+
Duel.ConfirmCards(1-tp,g)
66+
end
67+
end

pre-release/c100448003.lua

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
--ヘル・ダイブ・ボンバー
2+
--Infernal Strike Fighter
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Synchro Summon procedure: 1 Tuner + 1+ non-Tuner monsters
8+
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
9+
--Destroy as many face-up monsters on the field as possible, and if you do, inflict damage to your opponent equal to the combined original Levels of those destroyed monsters x 200
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
13+
e1:SetType(EFFECT_TYPE_QUICK_O)
14+
e1:SetCode(EVENT_FREE_CHAIN)
15+
e1:SetRange(LOCATION_MZONE)
16+
e1:SetCountLimit(1,{id,0})
17+
e1:SetCondition(function() return Duel.IsMainPhase2() end)
18+
e1:SetTarget(s.destg)
19+
e1:SetOperation(s.desop)
20+
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
21+
c:RegisterEffect(e1)
22+
--Special Summon 1 Level 5 or lower Machine monster from your GY in Defense Position
23+
local e2=Effect.CreateEffect(c)
24+
e2:SetDescription(aux.Stringid(id,1))
25+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
26+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
27+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
28+
e2:SetCode(EVENT_DESTROYED)
29+
e2:SetCountLimit(1,{id,1})
30+
e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_BATTLE|REASON_EFFECT) end)
31+
e2:SetTarget(s.sptg)
32+
e2:SetOperation(s.spop)
33+
c:RegisterEffect(e2)
34+
end
35+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
36+
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
37+
if chk==0 then return #g>0 end
38+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
39+
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetSum(Card.GetOriginalLevel)*200)
40+
end
41+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
42+
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
43+
if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 then
44+
local dam=Duel.GetOperatedGroup():GetSum(Card.GetOriginalLevel)*200
45+
if dam>0 then
46+
Duel.Damage(1-tp,dam,REASON_EFFECT)
47+
end
48+
end
49+
end
50+
function s.spfilter(c,e,tp)
51+
return c:IsLevelBelow(5) and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
52+
end
53+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
54+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
55+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
56+
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
57+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
58+
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
59+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
60+
end
61+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
62+
local tc=Duel.GetFirstTarget()
63+
if tc:IsRelateToEffect(e) then
64+
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
65+
end
66+
end

0 commit comments

Comments
 (0)