Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4947,7 +4947,8 @@ c["Cannot be Light Stunned if you haven't been Hit Recently"]={{[1]={[1]={neg=tr
c["Cannot be Poisoned"]={{[1]={flags=0,keywordFlags=0,name="PoisonImmune",type="FLAG",value=true}},nil}
c["Cannot be Shocked"]={{[1]={flags=0,keywordFlags=0,name="ShockImmune",type="FLAG",value=true}},nil}
c["Cannot be Stunned"]={{[1]={flags=0,keywordFlags=0,name="StunImmune",type="FLAG",value=true}},nil}
c["Cannot be Used manually"]={{[1]={flags=0,keywordFlags=0,name="UsedManuallyImmune",type="FLAG",value=true}},nil}
c["Cannot be Used manually"]={{},"Used manually "}
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 "}
c["Cannot collide with targets"]={nil,"Cannot collide with targets "}
c["Cannot gain Spirit from Equipment"]={{[1]={flags=0,keywordFlags=0,name="CannotGainSpiritFromEquipment",type="FLAG",value=true}},nil}
c["Cannot have Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="CannotHaveES",type="FLAG",value=true}},nil}
Expand Down
8 changes: 7 additions & 1 deletion src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6721,13 +6721,17 @@ local function parseMod(line, order)
modType = type(modValue) == "table" and modValue.type or "FLAG"
modValue = type(modValue) == "table" and modValue.value or true
elseif modForm == "IMMUNE" then
local effectLine = line:gsub("%s+$","") -- remove trailing spaces
local effectLine = line:gsub("%s+$",""):lower() -- remove trailing spaces and lower case
local _, numWords = effectLine:gsub("%S+", "")
local multiEffect = effectLine:find(" and ")

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

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

-- Process effect strings to valid mod names
Expand Down
Loading