begin adding healing event handling
This commit is contained in:
parent
7eddf36e16
commit
2832cecd9e
|
@ -259,6 +259,15 @@
|
||||||
(update-entity-damage-stats :in target-name damage-properties timestamp)
|
(update-entity-damage-stats :in target-name damage-properties timestamp)
|
||||||
(update-entity-damage-stats :out source-name damage-properties timestamp)))
|
(update-entity-damage-stats :out source-name damage-properties timestamp)))
|
||||||
|
|
||||||
|
(s/defn process-source-to-target-healing :- Encounter
|
||||||
|
[source-name :- s/Str
|
||||||
|
target-name :- s/Str
|
||||||
|
{:keys [skill]
|
||||||
|
:as heal-properties} :- HealProperties
|
||||||
|
timestamp :- Date
|
||||||
|
encounter :- Encounter]
|
||||||
|
encounter)
|
||||||
|
|
||||||
(s/defn process-entity-death :- Encounter
|
(s/defn process-entity-death :- Encounter
|
||||||
[entity-name :- s/Str
|
[entity-name :- s/Str
|
||||||
timestamp :- Date
|
timestamp :- Date
|
||||||
|
|
|
@ -122,12 +122,30 @@
|
||||||
(s/defmethod handle-event :skill-heals-target :- Encounter
|
(s/defmethod handle-event :skill-heals-target :- Encounter
|
||||||
[{:keys [source-name skill crit? target-name amount timestamp]} :- CombatEvent
|
[{:keys [source-name skill crit? target-name amount timestamp]} :- CombatEvent
|
||||||
encounter :- Encounter]
|
encounter :- Encounter]
|
||||||
encounter)
|
(analysis/process-source-to-target-healing
|
||||||
|
source-name
|
||||||
|
target-name
|
||||||
|
{:skill skill
|
||||||
|
:actual-skill? true
|
||||||
|
:amount amount
|
||||||
|
:crit? crit?}
|
||||||
|
timestamp
|
||||||
|
encounter))
|
||||||
|
|
||||||
(s/defmethod handle-event :resource-gained :- Encounter
|
(s/defmethod handle-event :resource-gained :- Encounter
|
||||||
[{:keys [target-name amount resource-type source-name skill timestamp]} :- CombatEvent
|
[{:keys [target-name amount resource-type source-name skill timestamp]} :- CombatEvent
|
||||||
encounter :- Encounter]
|
encounter :- Encounter]
|
||||||
encounter)
|
(condp = resource-type
|
||||||
|
:health (analysis/process-source-to-target-healing
|
||||||
|
source-name
|
||||||
|
target-name
|
||||||
|
{:skill skill
|
||||||
|
;:actual-skill? true ; TODO: this is not always true. e.g. if a potion is used (how to determine this?)
|
||||||
|
:amount amount
|
||||||
|
:crit? false}
|
||||||
|
timestamp
|
||||||
|
encounter)
|
||||||
|
encounter))
|
||||||
|
|
||||||
(s/defmethod handle-event :resource-lost :- Encounter
|
(s/defmethod handle-event :resource-lost :- Encounter
|
||||||
[{:keys [target-name amount resource-type source-name skill timestamp]} :- CombatEvent
|
[{:keys [target-name amount resource-type source-name skill timestamp]} :- CombatEvent
|
||||||
|
|
|
@ -94,3 +94,7 @@
|
||||||
; TODO
|
; TODO
|
||||||
(def DamageProperties
|
(def DamageProperties
|
||||||
{s/Any s/Any})
|
{s/Any s/Any})
|
||||||
|
|
||||||
|
; TODO
|
||||||
|
(def HealProperties
|
||||||
|
{s/Any s/Any})
|
||||||
|
|
Reference in a new issue