Skip to content

Commit f7a43af

Browse files
authored
Update "Dark Magic Curtain (Anime)"
- Should apply a lingering effect in the vein of Last Will - Reworked script to properly apply cost/summoning
1 parent fec02eb commit f7a43af

File tree

1 file changed

+37
-41
lines changed

1 file changed

+37
-41
lines changed

unofficial/c511002532.lua

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,54 @@
11
--黒魔術のカーテン (Anime)
22
--Dark Magic Curtain (Anime)
3-
--fixed by Larry126
43
local s,id=GetID()
54
function s.initial_effect(c)
65
--Activate
76
local e1=Effect.CreateEffect(c)
87
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
98
e1:SetType(EFFECT_TYPE_ACTIVATE)
109
e1:SetCode(EVENT_FREE_CHAIN)
11-
e1:SetCost(s.cost)
1210
e1:SetTarget(s.target)
1311
e1:SetOperation(s.activate)
1412
c:RegisterEffect(e1)
1513
end
16-
function s.spfilter(c,e,tp)
17-
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
18-
end
19-
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
20-
if chk==0 then return true end
21-
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
22-
local p=tp
23-
if Duel.IsExistingMatchingCard(s.spfilter,1-tp,LOCATION_DECK,0,1,nil,e,1-tp)
24-
and Duel.SelectYesNo(1-tp,aux.Stringid(102380,0)) then
25-
Duel.PayLPCost(1-tp,math.floor(Duel.GetLP(1-tp)/2))
26-
p=tp+1
27-
end
28-
e:SetLabel(p)
29-
end
3014
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
31-
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
32-
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
33-
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummon(1-tp) end
34-
local p=e:GetLabel()
35-
if p~=tp then
36-
p=PLAYER_ALL
37-
end
38-
Duel.SetTargetPlayer(p)
39-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,p==PLAYER_ALL and 2 or 1,p,LOCATION_DECK)
15+
if chk==0 then return true end
16+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_EITHER,LOCATION_DECK)
4017
end
4118
function s.activate(e,tp,eg,ep,ev,re,r,rp)
42-
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
43-
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
44-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
45-
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
46-
if #g>0 then
47-
Duel.SpecialSummonStep(g:GetFirst(),0,tp,tp,false,false,POS_FACEUP)
48-
end
49-
end
50-
if p==PLAYER_ALL and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
51-
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
52-
local g=Duel.SelectMatchingCard(1-tp,s.spfilter,1-tp,LOCATION_DECK,0,1,1,nil,e,1-tp)
53-
if #g>0 then
54-
Duel.SpecialSummonStep(g:GetFirst(),0,1-tp,1-tp,false,false,POS_FACEUP)
55-
end
19+
--You can Special Summon 1 DARK Spellcaster-Type monster from your Deck once this turn
20+
local e1=Effect.CreateEffect(e:GetHandler())
21+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
22+
e1:SetCode(EVENT_FREE_CHAIN)
23+
e1:SetCountLimit(1)
24+
e1:SetCondition(s.spcon)
25+
e1:SetOperation(s.spop)
26+
e1:SetReset(RESET_PHASE|PHASE_END)
27+
Duel.RegisterEffect(e1,tp)
28+
--Your opponent can Special Summon 1 DARK Spellcaster-Type monster from their Deck once this turn
29+
local e2=Effect.CreateEffect(e:GetHandler())
30+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
31+
e2:SetCode(EVENT_FREE_CHAIN)
32+
e2:SetCountLimit(1)
33+
e2:SetCondition(s.spcon)
34+
e2:SetOperation(s.spop)
35+
e2:SetReset(RESET_PHASE|PHASE_END)
36+
Duel.RegisterEffect(e2,1-tp)
37+
end
38+
function s.spfilter(c,e,sp)
39+
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
40+
end
41+
function s.spcon(e)
42+
local tp=e:GetHandlerPlayer()
43+
return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
44+
end
45+
function s.spop(e)
46+
local tp=e:GetHandlerPlayer()
47+
Duel.Hint(HINT_CARD,0,id)
48+
Duel.PayLPCost(tp,Duel.GetLP(tp)/2)
49+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
50+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
51+
if #g>0 then
52+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
5653
end
57-
Duel.SpecialSummonComplete()
58-
end
54+
end

0 commit comments

Comments
 (0)