Skip to content

Commit 3ac66a4

Browse files
authored
Update "Malice Doll of Demise"
- Prevent script errors
1 parent 96a6762 commit 3ac66a4

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

official/c72657739.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--Malice Doll of Demise
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--register
5+
--Register if this card is sent to the GY by a Continuous Spell effect
66
local e1=Effect.CreateEffect(c)
77
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
88
e1:SetCode(EVENT_TO_GRAVE)
@@ -11,32 +11,32 @@ function s.initial_effect(c)
1111
end
1212
function s.regop(e,tp,eg,ep,ev,re,r,rp)
1313
local c=e:GetHandler()
14+
local rc=re:GetHandler()
1415
if c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT)
15-
and re:GetActiveType()==TYPE_CONTINUOUS+TYPE_SPELL then
16+
and re:IsSpellEffect() and rc:IsContinuousSpell() then
1617
local e1=Effect.CreateEffect(c)
1718
e1:SetDescription(aux.Stringid(id,0))
1819
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
1920
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
2021
e1:SetCode(EVENT_PHASE|PHASE_STANDBY)
2122
e1:SetCountLimit(1)
2223
e1:SetRange(LOCATION_GRAVE)
23-
e1:SetCondition(s.spcon)
24+
e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
2425
e1:SetTarget(s.sptg)
2526
e1:SetOperation(s.spop)
2627
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN)
2728
c:RegisterEffect(e1)
2829
end
2930
end
30-
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
31-
return Duel.IsTurnPlayer(tp)
32-
end
3331
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
32+
local c=e:GetHandler()
3433
if chk==0 then return true end
35-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
34+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
3635
end
3736
function s.spop(e,tp,eg,ep,ev,re,r,rp)
37+
local c=e:GetHandler()
3838
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
39-
if e:GetHandler():IsRelateToEffect(e) then
40-
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
39+
if c:IsRelateToEffect(e) then
40+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
4141
end
42-
end
42+
end

0 commit comments

Comments
 (0)