Skip to content

Commit 5332c9b

Browse files
committed
Fix false positive on "Cannot be used manually"
"Cannot be used manually" on the "Opportunity, Ultimate Life Flask" unique flask was falsely parsed as "UsedManuallyImmune" Added an `effectBlacklist` to exclude this case and any others in future
1 parent 035a04f commit 5332c9b

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/Data/ModCache.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4947,7 +4947,8 @@ c["Cannot be Light Stunned if you haven't been Hit Recently"]={{[1]={[1]={neg=tr
49474947
c["Cannot be Poisoned"]={{[1]={flags=0,keywordFlags=0,name="PoisonImmune",type="FLAG",value=true}},nil}
49484948
c["Cannot be Shocked"]={{[1]={flags=0,keywordFlags=0,name="ShockImmune",type="FLAG",value=true}},nil}
49494949
c["Cannot be Stunned"]={{[1]={flags=0,keywordFlags=0,name="StunImmune",type="FLAG",value=true}},nil}
4950-
c["Cannot be Used manually"]={{[1]={flags=0,keywordFlags=0,name="UsedManuallyImmune",type="FLAG",value=true}},nil}
4950+
c["Cannot be Used manually"]={{},"Used manually "}
4951+
c["Cannot be Used manually Used when you release a skill with Perfect Timing"]={{},"Used manually Used when you release a skill with Perfect Timing "}
49514952
c["Cannot collide with targets"]={nil,"Cannot collide with targets "}
49524953
c["Cannot gain Spirit from Equipment"]={{[1]={flags=0,keywordFlags=0,name="CannotGainSpiritFromEquipment",type="FLAG",value=true}},nil}
49534954
c["Cannot have Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="CannotHaveES",type="FLAG",value=true}},nil}

src/Modules/ModParser.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6721,13 +6721,17 @@ local function parseMod(line, order)
67216721
modType = type(modValue) == "table" and modValue.type or "FLAG"
67226722
modValue = type(modValue) == "table" and modValue.value or true
67236723
elseif modForm == "IMMUNE" then
6724-
local effectLine = line:gsub("%s+$","") -- remove trailing spaces
6724+
local effectLine = line:gsub("%s+$",""):lower() -- remove trailing spaces and lower case
67256725
local _, numWords = effectLine:gsub("%S+", "")
67266726
local multiEffect = effectLine:find(" and ")
67276727

67286728
local function getEffectFromStatus(statusString)
67296729
return statusToEffectMap[statusString:lower()] or statusString
67306730
end
6731+
-- list of known false positives that should be excluded as they don't provide "immunity"
6732+
local effectBlacklist = {
6733+
["used manually"] = true, -- "Cannot be used manually" from "Opportunity, Ultimate Life Flask"
6734+
}
67316735

67326736
-- Check number of words, as 99% of effects consist of only one or two words
67336737
-- NOTE: needs exception for wordings like "freeze and chill"
@@ -6742,6 +6746,8 @@ local function parseMod(line, order)
67426746
end
67436747
elseif (numWords < 1) or (numWords > 2) then
67446748
return { }, line -- no words or more than 2 unlikely for single effect
6749+
elseif effectBlacklist[effectLine] then
6750+
return { }, line
67456751
end
67466752

67476753
-- Process effect strings to valid mod names

0 commit comments

Comments
 (0)