move old encounter "trigger-on-x?" flags under a :triggers key

This commit is contained in:
Gered 2016-03-09 13:20:24 -05:00
parent 8d84b9f2d5
commit 82795d9e5a
2 changed files with 20 additions and 20 deletions

View file

@ -22,18 +22,18 @@
"Golemagg the Incinerator" {:entities {"Golemagg the Incinerator" {:count 1} "Golemagg the Incinerator" {:entities {"Golemagg the Incinerator" {:count 1}
"Core Rager" {}}} "Core Rager" {}}}
"Majordomo Executus" {:entities {"Majordomo Executus" {:ignore-interactions-with ["Ragnaros"] "Majordomo Executus" {:entities {"Majordomo Executus" {:ignore-interactions-with ["Ragnaros"]
:ignore-skills ["Summon Ragnaros"]} :ignore-skills ["Summon Ragnaros"]}
"Flamewaker Healer" {:count 4} "Flamewaker Healer" {:count 4}
"Flamewaker Elite" {:count 4}} "Flamewaker Elite" {:count 4}}
:trigger-on-damage? true :triggers {:on-damage? true
:trigger-on-debuff? true} :on-debuff? true}}
"Ragnaros" {:entities {"Ragnaros" {:count 1 "Ragnaros" {:entities {"Ragnaros" {:count 1
:ignore-interactions-with ["Majordomo Executus"]} :ignore-interactions-with ["Majordomo Executus"]}
"Son of Flame" {:cannot-trigger? true}} "Son of Flame" {:cannot-trigger? true}}
:trigger-on-damage? true :triggers {:on-damage? true
:trigger-on-debuff? true} :on-debuff? true}}

View file

@ -76,7 +76,8 @@
(not (contained-in? skill non-combat-starting-skills))) (not (contained-in? skill non-combat-starting-skills)))
; now look at individual encounter-specific criteria for whether this combat event ; now look at individual encounter-specific criteria for whether this combat event
; can trigger the encounter or not ; can trigger the encounter or not
(let [encounter (get defined-encounters encounter-name)] (let [encounter (get defined-encounters encounter-name)
triggers (:triggers encounter)]
(cond (cond
(ignored-encounter-entity-interaction-event? encounter event) (ignored-encounter-entity-interaction-event? encounter event)
nil nil
@ -86,15 +87,14 @@
; if ANY of these are defined, then their criteria MUST pass to ; if ANY of these are defined, then their criteria MUST pass to
; trigger an encounter ; trigger an encounter
(or (:trigger-on-damage? encounter) triggers
(:trigger-on-aura? encounter)
(:trigger-on-buff? encounter)
(:trigger-on-debuff? encounter))
(cond (cond
(and (:trigger-on-damage? encounter) damage) encounter-name (and (:on-damage? triggers) damage) encounter-name
(and (:trigger-on-aura? encounter) aura-name) encounter-name (and (:on-aura? triggers) aura-name) encounter-name
(and (:trigger-on-buff? encounter) (= :buff type)) encounter-name (and (:on-buff? triggers) (= :buff type)) encounter-name
(and (:trigger-on-debuff? encounter) (= :debuff type)) encounter-name) (and (:on-debuff? triggers) (= :debuff type)) encounter-name
; this is also default behaviour if triggers aren't specified
(:on-anything? triggers) encounter-name)
:else :else
encounter-name))))) encounter-name)))))