Skip to content

Commit 02e2b29

Browse files
authored
Added new card scripts
1 parent 9c35d20 commit 02e2b29

File tree

2 files changed

+170
-0
lines changed

2 files changed

+170
-0
lines changed

pre-release/c100444301.lua

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
--大輪の霊使い
2+
--Charmers of the Grand Circle
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 2+ "Charmer" and/or "Familiar-Possessed" monsters
8+
Fusion.AddProcMixRep(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,{SET_CHARMER,SET_FAMILIAR_POSSESSED}),2,99)
9+
--Keep track of the number of different original Attributes of the monsters used as its material
10+
local e0=Effect.CreateEffect(c)
11+
e0:SetType(EFFECT_TYPE_SINGLE)
12+
e0:SetCode(EFFECT_MATERIAL_CHECK)
13+
e0:SetValue(function(e,c) e:SetLabel(c:GetMaterial():GetClassCount(Card.GetOriginalAttribute)) end)
14+
c:RegisterEffect(e0)
15+
--Repeat the process of applying 1 of these effects, up to the number of different original Attributes of the monsters used as its material (max. 4)
16+
local e1=Effect.CreateEffect(c)
17+
e1:SetDescription(aux.Stringid(id,0))
18+
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
19+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
20+
e1:SetProperty(EFFECT_FLAG_DELAY)
21+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
22+
e1:SetCountLimit(1,id)
23+
e1:SetCondition(function(e) return e:GetHandler():IsFusionSummoned() end)
24+
e1:SetTarget(s.efftg)
25+
e1:SetOperation(s.effop)
26+
e1:SetLabelObject(e0)
27+
c:RegisterEffect(e1)
28+
end
29+
s.listed_series={SET_CHARMER,SET_FAMILIAR_POSSESSED,SET_POSSESSED}
30+
s.material_setcode={SET_CHARMER,SET_FAMILIAR_POSSESSED}
31+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
32+
local material_check_eff=e:GetLabelObject()
33+
local label=material_check_eff:GetLabel()
34+
if chk==0 then return label>0 end
35+
material_check_eff:SetLabel(0)
36+
Duel.SetTargetParam(label)
37+
Duel.SetPossibleOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,800)
38+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_ONFIELD)
39+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
40+
end
41+
function s.thfilter(c)
42+
return c:IsSetCard(SET_POSSESSED) and c:IsSpellTrap() and c:IsAbleToHand()
43+
end
44+
function s.spfilter(c,e,tp)
45+
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
46+
end
47+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
48+
local c=e:GetHandler()
49+
local b1,b2,b3,b4,b5,op
50+
local max_count=math.min(Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM),4)
51+
local remaining_count=max_count
52+
repeat
53+
b1=c:IsRelateToEffect(e) and c:IsFaceup()
54+
b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
55+
b3=Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
56+
b4=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
57+
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
58+
if not (b1 or b2 or b3 or b4) then return end
59+
b5=remaining_count<max_count
60+
op=Duel.SelectEffect(tp,
61+
{b1,aux.Stringid(id,1)},
62+
{b2,aux.Stringid(id,2)},
63+
{b3,aux.Stringid(id,3)},
64+
{b4,aux.Stringid(id,4)},
65+
{b5,aux.Stringid(id,5)})
66+
remaining_count=remaining_count-1
67+
if op==1 then
68+
--This card gains 800 ATK
69+
c:UpdateAttack(800)
70+
elseif op==2 then
71+
--Add 1 "Possessed" Spell/Trap from your Deck to your hand
72+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
73+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
74+
if #g>0 then
75+
Duel.SendtoHand(g,nil,REASON_EFFECT)
76+
Duel.ConfirmCards(1-tp,g)
77+
end
78+
elseif op==3 then
79+
--Return 1 card on the field to the hand
80+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
81+
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
82+
if #g>0 then
83+
Duel.HintSelection(g)
84+
Duel.SendtoHand(g,nil,REASON_EFFECT)
85+
end
86+
elseif op==4 then
87+
--Special Summon 1 Spellcaster monster from your GY
88+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
89+
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
90+
if #g>0 then
91+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
92+
end
93+
elseif op==5 then
94+
--Finish applying effects
95+
return
96+
end
97+
until remaining_count==0
98+
end

pre-release/c100444302.lua

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
--大輪の魔導書
2+
--Spellbook of the Grand Circle
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Add 4 "Charmer" monsters with different Attributes from your Deck, GY, and/or banishment to your hand, then shuffle 2 cards from your hand into the Deck
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCountLimit(1,{id,0})
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.activate)
15+
c:RegisterEffect(e1)
16+
--Fusion Summon 1 Fusion Monster from your Extra Deck, using "Charmer" and/or "Familiar-Possessed" monsters from your hand or field, also your opponent cannot activate cards or effects when a monster is Fusion Summoned this way
17+
local fusion_params={
18+
matfilter=function(c) return c:IsSetCard({SET_CHARMER,SET_FAMILIAR_POSSESSED}) end,
19+
stage2=s.stage2
20+
}
21+
local e2=Effect.CreateEffect(c)
22+
e2:SetDescription(aux.Stringid(id,1))
23+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
24+
e2:SetType(EFFECT_TYPE_IGNITION)
25+
e2:SetRange(LOCATION_GRAVE)
26+
e2:SetCountLimit(1,{id,1})
27+
e2:SetCost(Cost.SelfBanish)
28+
e2:SetTarget(Fusion.SummonEffTG(fusion_params))
29+
e2:SetOperation(Fusion.SummonEffOP(fusion_params))
30+
c:RegisterEffect(e2)
31+
end
32+
s.listed_series={SET_CHARMER,SET_FAMILIAR_POSSESSED}
33+
function s.thfilter(c)
34+
return c:IsSetCard(SET_CHARMER) and c:IsMonster() and (c:IsLocation(LOCATION_DECK) or c:IsFaceup())
35+
and c:IsAbleToHand()
36+
end
37+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
38+
if chk==0 then
39+
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_REMOVED,0,nil)
40+
return aux.SelectUnselectGroup(g,e,tp,4,4,aux.dpcheck(Card.GetAttribute),0)
41+
end
42+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_REMOVED)
43+
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
44+
end
45+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
46+
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_REMOVED,0,nil)
47+
if #g<4 then return end
48+
local sg=aux.SelectUnselectGroup(g,e,tp,4,4,aux.dpcheck(Card.GetAttribute),1,tp,HINTMSG_ATOHAND)
49+
if #sg==4 and Duel.SendtoHand(sg,nil,REASON_EFFECT)==4 then
50+
Duel.ConfirmCards(1-tp,sg)
51+
Duel.ShuffleHand(tp)
52+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
53+
local tdg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,2,2,nil)
54+
if #tdg==2 then
55+
Duel.BreakEffect()
56+
Duel.SendtoDeck(tdg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
57+
end
58+
end
59+
end
60+
function s.stage2(e,fc,tp,sg,chk)
61+
if chk==1 then
62+
--Your opponent cannot activate cards or effects when a monster is Fusion Summoned this way
63+
local e1=Effect.CreateEffect(e:GetHandler())
64+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
65+
e1:SetCode(EVENT_CHAIN_END)
66+
e1:SetOperation(function(e)
67+
Duel.SetChainLimitTillChainEnd(function(e,ep,tp) return tp==ep end)
68+
e:Reset()
69+
end)
70+
Duel.RegisterEffect(e1,tp)
71+
end
72+
end

0 commit comments

Comments
 (0)