Skip to content

Commit 95054ba

Browse files
committed
Fix Mask of Dispel and Mask of the Accursed
- Fixed a bug in Mask of Dispel where it wasn't checking in resolution who the controller of the Spell was. Also removed the wrong Equip category, added the Damage category, corrected the SetOperationInfo - Fixed the same controller bug in Mask of the Accursed as well as added the Damage category - script cleanup and modernization Credits to ClaireStanfield on Github
1 parent 6c5940e commit 95054ba

2 files changed

Lines changed: 28 additions & 35 deletions

File tree

official/c20765952.lua

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ local s,id=GetID()
44
function s.initial_effect(c)
55
--Activate
66
local e1=Effect.CreateEffect(c)
7-
e1:SetCategory(CATEGORY_EQUIP)
87
e1:SetType(EFFECT_TYPE_ACTIVATE)
98
e1:SetCode(EVENT_FREE_CHAIN)
109
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
1110
e1:SetTarget(s.target)
1211
e1:SetOperation(s.operation)
1312
c:RegisterEffect(e1)
14-
--damage
13+
--Inflict 500 damage to that Spell's controller
1514
local e2=Effect.CreateEffect(c)
1615
e2:SetDescription(aux.Stringid(id,0))
16+
e2:SetCategory(CATEGORY_DAMAGE)
1717
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
1818
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
1919
e2:SetCode(EVENT_PHASE|PHASE_STANDBY)
@@ -23,13 +23,13 @@ function s.initial_effect(c)
2323
e2:SetTarget(s.damtg)
2424
e2:SetOperation(s.damop)
2525
c:RegisterEffect(e2)
26-
--Destroy
26+
--When that Spell leaves the field, destroy this card
2727
local e3=Effect.CreateEffect(c)
2828
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
2929
e3:SetRange(LOCATION_SZONE)
3030
e3:SetCode(EVENT_LEAVE_FIELD)
3131
e3:SetCondition(s.descon)
32-
e3:SetOperation(s.desop)
32+
e3:SetOperation(function(e) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end)
3333
c:RegisterEffect(e3)
3434
end
3535
function s.filter(c)
@@ -55,22 +55,17 @@ function s.damcon(e,tp,eg,ep,ev,re,r,rp)
5555
end
5656
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
5757
if chk==0 then return true end
58-
local tc=e:GetHandler():GetFirstCardTarget()
59-
Duel.SetTargetPlayer(tc:GetControler())
58+
local p=e:GetHandler():GetFirstCardTarget():GetControler()
59+
Duel.SetTargetPlayer(p)
6060
Duel.SetTargetParam(500)
61-
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,Duel.GetTurnPlayer(),500)
61+
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,p,500)
6262
end
6363
function s.damop(e,tp,eg,ep,ev,re,r,rp)
64-
if not e:GetHandler():IsRelateToEffect(e) then return end
65-
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
64+
local p=e:GetHandler():GetFirstCardTarget():GetControler()
65+
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
6666
Duel.Damage(p,d,REASON_EFFECT)
6767
end
6868
function s.descon(e,tp,eg,ep,ev,re,r,rp)
69-
local c=e:GetHandler()
70-
if c:IsStatus(STATUS_DESTROY_CONFIRMED) then return false end
71-
local tc=c:GetFirstCardTarget()
69+
local tc=e:GetHandler():GetFirstCardTarget()
7270
return tc and eg:IsContains(tc)
73-
end
74-
function s.desop(e,tp,eg,ep,ev,re,r,rp)
75-
Duel.Destroy(e:GetHandler(), REASON_EFFECT)
7671
end

official/c56948373.lua

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,24 @@
33
local s,id=GetID()
44
function s.initial_effect(c)
55
aux.AddEquipProcedure(c)
6-
--Atk,def
6+
--The equipped monster cannot attack
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetType(EFFECT_TYPE_EQUIP)
9+
e1:SetCode(EFFECT_CANNOT_ATTACK)
10+
c:RegisterEffect(e1)
11+
--Inflict 500 damage to the controller of the equipped monster
712
local e2=Effect.CreateEffect(c)
8-
e2:SetType(EFFECT_TYPE_EQUIP)
9-
e2:SetCode(EFFECT_CANNOT_ATTACK)
13+
e2:SetDescription(aux.Stringid(id,0))
14+
e2:SetCategory(CATEGORY_DAMAGE)
15+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
16+
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
17+
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
18+
e2:SetRange(LOCATION_SZONE)
19+
e2:SetCountLimit(1)
20+
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
21+
e2:SetTarget(s.damtg)
22+
e2:SetOperation(s.damop)
1023
c:RegisterEffect(e2)
11-
--damage
12-
local e4=Effect.CreateEffect(c)
13-
e4:SetDescription(aux.Stringid(id,0))
14-
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
15-
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
16-
e4:SetCode(EVENT_PHASE|PHASE_STANDBY)
17-
e4:SetRange(LOCATION_SZONE)
18-
e4:SetCountLimit(1)
19-
e4:SetCondition(s.damcon)
20-
e4:SetTarget(s.damtg)
21-
e4:SetOperation(s.damop)
22-
c:RegisterEffect(e4)
23-
end
24-
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
25-
return Duel.IsTurnPlayer(tp) and e:GetHandler():GetEquipTarget()~=nil
2624
end
2725
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
2826
if chk==0 then return true end
@@ -32,7 +30,7 @@ function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
3230
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,p,500)
3331
end
3432
function s.damop(e,tp,eg,ep,ev,re,r,rp)
35-
if not e:GetHandler():IsRelateToEffect(e) then return end
36-
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
33+
local p=e:GetHandler():GetEquipTarget():GetControler()
34+
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
3735
Duel.Damage(p,d,REASON_EFFECT)
3836
end

0 commit comments

Comments
 (0)