Skip to content

Commit 3926f39

Browse files
authored
Update "Stairway to the Underworld"
-Added another check to the condition to ensure that only direct attacks while there were no monsters on the field were counted. -Updated the function calls to better reflect modern script architecture.
1 parent 9db4143 commit 3926f39

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

unofficial/c511000921.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
Duel.LoadScript("c420.lua")
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
--activate
6+
--Special Summon 2 "Emissary of Darkness" monsters from your Deck
77
local e1=Effect.CreateEffect(c)
88
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
99
e1:SetType(EFFECT_TYPE_ACTIVATE)
1010
e1:SetCode(EVENT_BATTLE_DAMAGE)
11-
e1:SetCondition(s.condition)
12-
e1:SetTarget(s.target)
13-
e1:SetOperation(s.activate)
11+
e1:SetCondition(s.spcon)
12+
e1:SetTarget(s.sptg)
13+
e1:SetOperation(s.spop)
1414
c:RegisterEffect(e1)
15-
--Trap Spell
15+
--Trap Spell properties
1616
local e2=Effect.CreateEffect(c)
1717
e2:SetType(EFFECT_TYPE_SINGLE)
1818
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
@@ -25,22 +25,22 @@ function s.initial_effect(c)
2525
e3:SetDescription(aux.Stringid(id,0))
2626
c:RegisterEffect(e3)
2727
end
28-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
29-
return ep==tp and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
28+
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
29+
return ep==tp and Duel.GetAttackTarget()==nil and Duel.GetFieidGroupCount(tp,LOCATION_MZONE,0)==0
3030
end
31-
function s.filter(c,e,tp)
31+
function s.spfilter(c,e,tp)
3232
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsEmissaryOfDarkness()
3333
end
34-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
34+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
3535
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
36-
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,2,nil,e,tp) end
37-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
36+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) end
37+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
3838
end
39-
function s.activate(e,tp,eg,ep,ev,re,r,rp)
39+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
4040
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
4141
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
42-
local sg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
42+
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
4343
if #sg>0 then
4444
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
4545
end
46-
end
46+
end

0 commit comments

Comments
 (0)