consolidate display construct

This commit is contained in:
ntr 2019-12-04 19:25:14 +10:00
parent d53d14233a
commit fc721c9ac5
2 changed files with 14 additions and 12 deletions

View File

@ -595,7 +595,7 @@ impl Construct {
amount: red_damage_amount, amount: red_damage_amount,
mitigation: red_mitigation, mitigation: red_mitigation,
colour: Colour::Red, colour: Colour::Red,
stats: EventConstruct::new(self), display: EventConstruct::new(self),
}, self.id)); }, self.id));
} }
@ -624,7 +624,7 @@ impl Construct {
amount: blue_damage_amount, amount: blue_damage_amount,
mitigation: blue_mitigation, mitigation: blue_mitigation,
colour: Colour::Blue, colour: Colour::Blue,
stats: EventConstruct::new(self), display: EventConstruct::new(self),
}, self.id)); }, self.id));
} }
} }
@ -670,7 +670,7 @@ impl Construct {
amount: delta, amount: delta,
mitigation: 0, mitigation: 0,
colour: Colour::Green, colour: Colour::Green,
stats: EventConstruct::new(self), display: EventConstruct::new(self),
}, self.id)); }, self.id));
} }
} }
@ -713,7 +713,7 @@ impl Construct {
amount: delta, amount: delta,
mitigation, mitigation,
colour: Colour::Red, colour: Colour::Red,
stats: EventConstruct::new(self), display: EventConstruct::new(self),
}, },
self.id self.id
)); ));
@ -779,7 +779,7 @@ impl Construct {
amount: delta, amount: delta,
mitigation, mitigation,
colour: Colour::Blue, colour: Colour::Blue,
stats: EventConstruct::new(self), display: EventConstruct::new(self),
}, self.id)); }, self.id));
}, },
true => { true => {
@ -835,7 +835,7 @@ impl Construct {
EventVariant::Effect { EventVariant::Effect {
effect: effect.effect, effect: effect.effect,
duration: effect.duration, duration: effect.duration,
construct_effects: self.effects.clone(), display: EventConstruct::new(self),
}, self.id }, self.id
); );

View File

@ -249,8 +249,11 @@ impl Event {
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)] #[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
pub enum EventVariant { pub enum EventVariant {
Hit { skill: Skill }, Hit { skill: Skill },
Damage { amount: usize, mitigation: usize, colour: Colour, stats: EventConstruct },
Effect { effect: Effect, duration: u8, construct_effects: Vec<ConstructEffect> }, Damage { amount: usize, mitigation: usize, colour: Colour, display: EventConstruct },
Effect { effect: Effect, duration: u8, display: EventConstruct },
Removal { effect: Option<Effect>, display: EventConstruct },
Disable { disable: Disable }, Disable { disable: Disable },
Healing { amount: usize, overhealing: usize }, Healing { amount: usize, overhealing: usize },
Recharge { red: usize, blue: usize }, Recharge { red: usize, blue: usize },
@ -258,7 +261,6 @@ pub enum EventVariant {
Reflection { skill: Skill }, Reflection { skill: Skill },
AoeSkill { skill: Skill }, AoeSkill { skill: Skill },
Skill { skill: Skill }, Skill { skill: Skill },
Removal { effect: Option<Effect>, construct_effects: Vec<ConstructEffect> },
TargetKo { skill: Skill }, TargetKo { skill: Skill },
// skill not necessary but makes it neater as all events are arrays in js // skill not necessary but makes it neater as all events are arrays in js
Ko (), Ko (),
@ -276,7 +278,7 @@ impl EventVariant {
match self { match self {
EventVariant::Disable { disable: _} EventVariant::Disable { disable: _}
=> EventStages::PostOnly, => EventStages::PostOnly,
EventVariant::Damage { amount: _, mitigation: _, colour: _, stats: _ } EventVariant::Damage { amount: _, mitigation: _, colour: _, display: _ }
=> EventStages::PostOnly, => EventStages::PostOnly,
EventVariant::Healing { amount: _, overhealing: _} EventVariant::Healing { amount: _, overhealing: _}
=> EventStages::PostOnly, => EventStages::PostOnly,
@ -290,9 +292,9 @@ impl EventVariant {
=> EventStages::PostOnly, => EventStages::PostOnly,
EventVariant::Skill { skill: _ } EventVariant::Skill { skill: _ }
=> EventStages::PostOnly, => EventStages::PostOnly,
EventVariant::Effect { effect: _, duration: _, construct_effects: _ } EventVariant::Effect { effect: _, duration: _, display: _ }
=> EventStages::PostOnly, => EventStages::PostOnly,
EventVariant::Removal { effect: _, construct_effects: _ } EventVariant::Removal { effect: _, display: _ }
=> EventStages::PostOnly, => EventStages::PostOnly,
EventVariant::TargetKo { skill: _ } EventVariant::TargetKo { skill: _ }
=> EventStages::PostOnly, => EventStages::PostOnly,