set animfocus server side

This commit is contained in:
Mashy
2019-12-06 20:50:47 +10:00
parent 261ab1d48b
commit b405608510
3 changed files with 11 additions and 18 deletions
+7
View File
@@ -231,6 +231,7 @@ pub type Disable = Vec<Effect>;
#[derive(Debug,Clone,PartialEq,Serialize,Deserialize)]
pub struct Event {
pub cast: Cast,
pub focus: Vec<Uuid>,
pub variant: EventVariant,
pub delay: i64,
}
@@ -274,8 +275,14 @@ impl EventVariant {
pub fn to_event(&self, cast: Cast) -> Event {
let delay = self.delay();
let focus = match self {
EventVariant::HitAoe { target: _ } => vec![cast.source, cast.target], // some tricky multi target here l8r
_ => vec![cast.source, cast.target],
};
Event {
cast,
focus,
variant: *self,
delay,
}