From fc721c9ac5a336c386bb6873481087bbf92df75d Mon Sep 17 00:00:00 2001 From: ntr Date: Wed, 4 Dec 2019 19:25:14 +1000 Subject: [PATCH] consolidate display construct --- core/src/construct.rs | 12 ++++++------ core/src/skill.rs | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/core/src/construct.rs b/core/src/construct.rs index d40cf2bd..d8318b9d 100644 --- a/core/src/construct.rs +++ b/core/src/construct.rs @@ -595,7 +595,7 @@ impl Construct { amount: red_damage_amount, mitigation: red_mitigation, colour: Colour::Red, - stats: EventConstruct::new(self), + display: EventConstruct::new(self), }, self.id)); } @@ -624,7 +624,7 @@ impl Construct { amount: blue_damage_amount, mitigation: blue_mitigation, colour: Colour::Blue, - stats: EventConstruct::new(self), + display: EventConstruct::new(self), }, self.id)); } } @@ -670,7 +670,7 @@ impl Construct { amount: delta, mitigation: 0, colour: Colour::Green, - stats: EventConstruct::new(self), + display: EventConstruct::new(self), }, self.id)); } } @@ -713,7 +713,7 @@ impl Construct { amount: delta, mitigation, colour: Colour::Red, - stats: EventConstruct::new(self), + display: EventConstruct::new(self), }, self.id )); @@ -779,7 +779,7 @@ impl Construct { amount: delta, mitigation, colour: Colour::Blue, - stats: EventConstruct::new(self), + display: EventConstruct::new(self), }, self.id)); }, true => { @@ -835,7 +835,7 @@ impl Construct { EventVariant::Effect { effect: effect.effect, duration: effect.duration, - construct_effects: self.effects.clone(), + display: EventConstruct::new(self), }, self.id ); diff --git a/core/src/skill.rs b/core/src/skill.rs index 1e3708e9..8402ff5b 100644 --- a/core/src/skill.rs +++ b/core/src/skill.rs @@ -249,8 +249,11 @@ impl Event { #[derive(Debug,Clone,PartialEq,Serialize,Deserialize)] pub enum EventVariant { Hit { skill: Skill }, - Damage { amount: usize, mitigation: usize, colour: Colour, stats: EventConstruct }, - Effect { effect: Effect, duration: u8, construct_effects: Vec }, + + Damage { amount: usize, mitigation: usize, colour: Colour, display: EventConstruct }, + Effect { effect: Effect, duration: u8, display: EventConstruct }, + Removal { effect: Option, display: EventConstruct }, + Disable { disable: Disable }, Healing { amount: usize, overhealing: usize }, Recharge { red: usize, blue: usize }, @@ -258,7 +261,6 @@ pub enum EventVariant { Reflection { skill: Skill }, AoeSkill { skill: Skill }, Skill { skill: Skill }, - Removal { effect: Option, construct_effects: Vec }, TargetKo { skill: Skill }, // skill not necessary but makes it neater as all events are arrays in js Ko (), @@ -276,7 +278,7 @@ impl EventVariant { match self { EventVariant::Disable { disable: _} => EventStages::PostOnly, - EventVariant::Damage { amount: _, mitigation: _, colour: _, stats: _ } + EventVariant::Damage { amount: _, mitigation: _, colour: _, display: _ } => EventStages::PostOnly, EventVariant::Healing { amount: _, overhealing: _} => EventStages::PostOnly, @@ -290,9 +292,9 @@ impl EventVariant { => EventStages::PostOnly, EventVariant::Skill { skill: _ } => EventStages::PostOnly, - EventVariant::Effect { effect: _, duration: _, construct_effects: _ } + EventVariant::Effect { effect: _, duration: _, display: _ } => EventStages::PostOnly, - EventVariant::Removal { effect: _, construct_effects: _ } + EventVariant::Removal { effect: _, display: _ } => EventStages::PostOnly, EventVariant::TargetKo { skill: _ } => EventStages::PostOnly,