fix negated conditionals using multi and fix revenge proc from reactive

This commit is contained in:
Jrc13245
2025-11-26 13:32:23 -05:00
parent 6a4f7a417c
commit 5e26b776eb
2 changed files with 13 additions and 9 deletions
+9 -7
View File
@@ -76,9 +76,11 @@ local function Or(t,func)
end
-- Helper to choose And() or Or() based on operator metadata
-- For negated conditionals:
-- - If operator is OR (or not specified), use Or() -> any negation matches
-- - If operator is AND, use And() -> all negations must match
-- For negated conditionals (nomybuff, nozone, etc.):
-- - OR separator (/) uses And() logic -> ALL negations must match (e.g., missing ALL buffs)
-- - AND separator (&) uses Or() logic -> ANY negation can match (e.g., missing ANY buff)
-- This is inverted from positive conditionals due to De Morgan's law:
-- NOT(A OR B OR C) = (NOT A) AND (NOT B) AND (NOT C)
local function NegatedMulti(t, func, conditionals, condition)
if type(func) ~= "function" then return false end
if type(t) ~= "table" then
@@ -92,11 +94,11 @@ local function NegatedMulti(t, func, conditionals, condition)
end
if operatorType == "AND" then
-- AND operator: ALL values must fail the check (original And behavior)
return And(t, func)
else
-- OR operator (default): ANY value can fail the check
-- AND separator (&): ANY negation can match
return Or(t, func)
else
-- OR separator (/) [default]: ALL negations must match
return And(t, func)
end
end
+4 -2
View File
@@ -2592,10 +2592,12 @@ local reactivePatterns = {
},
Revenge = {
-- Procs when YOU block, dodge, or parry an enemy attack (any stance)
-- Does NOT require targeting the triggering mob - can use on any target
patterns = {
"You block", -- English: "You block X's Y"
"You dodge", -- English: "You dodge X's Y"
"You parry", -- English: "You parry X's Y"
" blocked%)", -- English: "X hits you for Y (Z blocked)"
"Ihr blockt", -- German block
"Ihr weicht aus", -- German dodge
"Ihr pariert", -- German parry
@@ -2613,8 +2615,8 @@ local reactivePatterns = {
"你招架了", -- Chinese Traditional parry
},
type = "player_avoid",
requiresTargetGUID = true, -- Track which enemy triggered it
duration = 4.0 -- 4 second proc window
requiresTargetGUID = false, -- Revenge usable on any target once procced
duration = 5.0 -- 5 second proc window
}
}