From 08b4ac32d7f13c70078d352db6cf905add505f6f Mon Sep 17 00:00:00 2001 From: gered Date: Tue, 8 Mar 2016 12:51:41 -0500 Subject: [PATCH] add missing regex matcher for another skill absorb event variation --- VWoWRLAHelper/matchers.lua | 3 ++- vwowrla.core/src/vwowrla/core/events/matchers.clj | 10 ++++++++++ .../core/matchers/skill_avoided_by_target_test.clj | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/VWoWRLAHelper/matchers.lua b/VWoWRLAHelper/matchers.lua index dabf390..34c06fb 100644 --- a/VWoWRLAHelper/matchers.lua +++ b/VWoWRLAHelper/matchers.lua @@ -108,7 +108,8 @@ vwowrla_combat_log_patterns = { event = "skill-avoided-by-target", pattern = { "^(.+) resists your (.+)%.$", - "^(.+) is immune to your (.+)%.$" + "^(.+) is immune to your (.+)%.$", + "^(.+) absorbs? your (.+)%.$" }, fn = function(matches) return { diff --git a/vwowrla.core/src/vwowrla/core/events/matchers.clj b/vwowrla.core/src/vwowrla/core/events/matchers.clj index 75fc4fd..287a16c 100644 --- a/vwowrla.core/src/vwowrla/core/events/matchers.clj +++ b/vwowrla.core/src/vwowrla/core/events/matchers.clj @@ -296,6 +296,16 @@ :skill %3 :avoidance-method :absorb)} + {:regex #"^(.+?) (?:absorb|absorbs) your (.+)\.$" + :id :skill-absorb-2-self + :logfmt :skill-absorb-2-self + :event :skill-avoided-by-target + :args #(hash-map + :target-name %1 + :skill %2 + :source-name "you" + :avoidance-method :absorb)} + ; i don't think target is ever "you" for this one {:regex #"^(.+?)'s (.+) was resisted by (.+)\.$" :id :skill-resist-2 diff --git a/vwowrla.core/test/vwowrla/core/matchers/skill_avoided_by_target_test.clj b/vwowrla.core/test/vwowrla/core/matchers/skill_avoided_by_target_test.clj index 856f6c5..13cc098 100644 --- a/vwowrla.core/test/vwowrla/core/matchers/skill_avoided_by_target_test.clj +++ b/vwowrla.core/test/vwowrla/core/matchers/skill_avoided_by_target_test.clj @@ -505,6 +505,20 @@ :skill "Unit Test's Attack" :avoidance-method :absorb}))) +(deftest skill-absorb-2-self + (is (valid-matcher? (get-matcher regex-matchers :skill-absorb-2-self))) + + (is (= (parse-line "2/7 22:35:41.365 You absorb your Poisonous Blood." options) + {:id :skill-absorb-2-self + :logfmt :skill-absorb-2-self + :event :skill-avoided-by-target + :line "2/7 22:35:41.365 You absorb your Poisonous Blood." + :timestamp (parse-log-timestamp "2/7 22:35:41.365" options) + :target-name owner-char-name + :source-name owner-char-name + :skill "Poisonous Blood" + :avoidance-method :absorb}))) + (deftest skill-resist-2 (is (valid-matcher? (get-matcher regex-matchers :skill-resist-2)))