From 0ffbfa8895723226607a44db6e1c208d1e32a1a8 Mon Sep 17 00:00:00 2001 From: ClaireStanfield Date: Thu, 18 Jan 2024 22:10:18 -0500 Subject: [PATCH] Fix Mask of Dispel and Mask of the Accursed --- official/c20765952.lua | 25 ++++++++++--------------- official/c56948373.lua | 39 +++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/official/c20765952.lua b/official/c20765952.lua index 91b344ce27..6b9482b4ce 100644 --- a/official/c20765952.lua +++ b/official/c20765952.lua @@ -4,16 +4,16 @@ local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) - --damage + --Inflict 500 damage to that Spell's controller local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_PHASE+PHASE_STANDBY) @@ -23,13 +23,13 @@ function s.initial_effect(c) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) - --Destroy + --When that Spell leaves the field, destroy this card local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_SZONE) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCondition(s.descon) - e3:SetOperation(s.desop) + e3:SetOperation(function(e) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end) c:RegisterEffect(e3) end function s.filter(c) @@ -55,22 +55,17 @@ function s.damcon(e,tp,eg,ep,ev,re,r,rp) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end - local tc=e:GetHandler():GetFirstCardTarget() - Duel.SetTargetPlayer(tc:GetControler()) + local p=e:GetHandler():GetFirstCardTarget():GetControler() + Duel.SetTargetPlayer(p) Duel.SetTargetParam(500) - Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,Duel.GetTurnPlayer(),500) + Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,p,500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end - local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) + local p=e:GetHandler():GetFirstCardTarget():GetControler() + local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end function s.descon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if c:IsStatus(STATUS_DESTROY_CONFIRMED) then return false end - local tc=c:GetFirstCardTarget() + local tc=e:GetHandler():GetFirstCardTarget() return tc and eg:IsContains(tc) end -function s.desop(e,tp,eg,ep,ev,re,r,rp) - Duel.Destroy(e:GetHandler(), REASON_EFFECT) -end diff --git a/official/c56948373.lua b/official/c56948373.lua index b021aa288b..ebac7e7edc 100644 --- a/official/c56948373.lua +++ b/official/c56948373.lua @@ -1,27 +1,26 @@ --呪魂の仮面 +--Mask of the Accursed local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c) - --Atk,def + --The equipped monster cannot attack + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_EQUIP) + e1:SetCode(EFFECT_CANNOT_ATTACK) + c:RegisterEffect(e1) + --Inflict 500 damage to the controller of the equipped monster local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_EQUIP) - e2:SetCode(EFFECT_CANNOT_ATTACK) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_DAMAGE) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e2:SetCode(EVENT_PHASE+PHASE_STANDBY) + e2:SetRange(LOCATION_SZONE) + e2:SetCountLimit(1) + e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end) + e2:SetTarget(s.damtg) + e2:SetOperation(s.damop) c:RegisterEffect(e2) - --damage - local e4=Effect.CreateEffect(c) - e4:SetDescription(aux.Stringid(id,0)) - e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) - e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e4:SetCode(EVENT_PHASE+PHASE_STANDBY) - e4:SetRange(LOCATION_SZONE) - e4:SetCountLimit(1) - e4:SetCondition(s.damcon) - e4:SetTarget(s.damtg) - e4:SetOperation(s.damop) - c:RegisterEffect(e4) -end -function s.damcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetTurnPlayer()==tp and e:GetHandler():GetEquipTarget()~=nil end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end @@ -31,7 +30,7 @@ function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,p,500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end - local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) + local p=e:GetHandler():GetEquipTarget():GetControler() + local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end