From 45c7ad0a854c58810ccf413998b276b8b4c5b33f Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Thu, 18 Feb 2010 21:21:35 -0600 Subject: [PATCH] Added use effect handler --- Regexps.lua | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/Regexps.lua b/Regexps.lua index 5426f20..806493c 100644 --- a/Regexps.lua +++ b/Regexps.lua @@ -148,9 +148,61 @@ local EquipStatsAffixes = { "%.$", } +local UseEffectMatchLines = { + "^use: ", +} + +local UseEffectIgnoreLines = { + "^use: heal", + "^use: a strong alcoholic beverage", + "^use: transform", + "^use: a sample of ", + "^use: a typical alcoholic beverage", + " if they have free room ", + "^use: a weak alcohol", + "^use: throw into ", + "^use: a strangely glowing alcoholic beverage", + "^use: instantly restores ", +} + +local UseEffectUnweightedLines = { + "^[^%d]+ %(%d[%a%d ]+ cooldown%)$", + "^use: absorbs ", + "^use: coats a weapon with poison ", +} + +local UseEffectPreprocessLines = { + {" decreases your ", " decreases "}, + {" all magical resistances ", " all resistances "}, + {" additional ", " "}, + {" maximum health ", " health "}, + {" all attributes ", " all stats "}, +} + +local UseEffectAffixes = { + "^use: +", + "^a powerful ale that +", + "^increases +", + "^the target's +", + "^the player's +", + "^your +", + "^restores +", + "^gives the gift of the wild to all party and raid members, increasing +", + " +%([14] sec cooldown%)$", + " +only one scroll effect can be active at a time%.$", + " +for 5 min%.$", + " +30 mins?%.$", + " +1 hour%.$", + " +for$", + " +lasts$", + " +for all party and raid members$", + "%.$", +} + EffectHandlers = { {EquipStatsMatchLines, {}, EquipStatsUnweightedLines, EquipStatsPreprocessLines, EquipStatsAffixes, "equipStats"}, {FoodMatchLines, FoodIgnoreLines, FoodUnweightedLines, FoodPreprocessLines, FoodAffixes, "food"}, + {UseEffectMatchLines, UseEffectIgnoreLines, UseEffectUnweightedLines, UseEffectPreprocessLines, UseEffectAffixes, "useEffects"}, } function WeightsWatcher.twoStats(text, pattern) @@ -340,7 +392,6 @@ UnweightedLines = { "chance t?on? ", "^use: .*enchants? ", "^equip: you", - "^use: coats a weapon with poison ", "^equip: causes your ", } -- 1.7.9.5