From a91086a15c3e7cb7536b15326657330dba01d7f2 Mon Sep 17 00:00:00 2001 From: pepopo978 Date: Thu, 3 Apr 2025 09:32:44 -0700 Subject: [PATCH] add handling for miss/parry/immune --- Localization.lua | 6 ++++++ curses.lua | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Localization.lua b/Localization.lua index 54eeb38..fe617cc 100644 --- a/Localization.lua +++ b/Localization.lua @@ -34,6 +34,9 @@ L:RegisterTranslations("enUS", function() -- curses ["(.+) fades from (.+)"] = true, ["Your (.+) was resisted by (.+)"] = true, + ["Your (.+) missed (.+)"] = true, + ["Your (.+) is parried by (.+)"] = true, + ["Your (.+) fails. (.+) is immune"] = true, -- global ["|cffffcc00Cursive:|cffffaaaa Couldn't detect SuperWoW."] = true, @@ -219,6 +222,9 @@ L:RegisterTranslations("zhCN", function() -- curses ["(.+) fades from (.+)"] = "(.+)效果从(.+)身上消失", ["Your (.+) was resisted by (.+)"] = "你的(.+)被(.+)抵抗了", + ["Your (.+) missed (.+)"] = "你的(.+)未命中(.+)", + ["Your (.+) is parried by (.+)"] = "你的(.+)被(.+)招架", + ["Your (.+) fails. (.+) is immune"] = "你的(.+)失败,(.+)免疫", -- global ["|cffffcc00Cursive:|cffffaaaa Couldn't detect SuperWoW."] = "|cffffcc00Cursive:|cffffaaaa 无法检测到SuperWoW.", diff --git a/curses.lua b/curses.lua index b859537..4b4b326 100644 --- a/curses.lua +++ b/curses.lua @@ -32,6 +32,9 @@ local curses = { -- combat events for curses local fades_test = L["(.+) fades from (.+)"] local resist_test = L["Your (.+) was resisted by (.+)"] +local missed_test = L["Your (.+) missed (.+)"] +local parry_test = L["Your (.+) is parried by (.+)"] +local immune_test = L["Your (.+) fails. (.+) is immune"] local lastGuid = nil @@ -224,6 +227,19 @@ Cursive:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE", function(message) -- check for resist local _, _, spellName, target = string.find(message, resist_test) + -- check for missed + if not spellName then + _, _, spellName, target = string.find(message, missed_test) + end + -- check for parry + if not spellName then + _, _, spellName, target = string.find(message, parry_test) + end + -- check for immune + if not spellName then + _, _, spellName, target = string.find(message, immune_test) + end + if spellName and target then spellName = string.lower(spellName)