From 4758ae1987858fb5a989c10a93c36afe1122445f Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 2 May 2019 11:51:56 +1000 Subject: [PATCH] siphon test fix --- client/src/events.jsx | 5 +++-- server/src/skill.rs | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/src/events.jsx b/client/src/events.jsx index 689ca37d..c272ab88 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -20,13 +20,14 @@ function registerEvents(store) { // cryp animations function crypAnimations() { - anime({ + const cryps = document.querySelectorAll('img'); + if (!cryps.length) return window.requestAnimationFrame(crypAnimations); + return anime({ targets: 'img', translateX: () => anime.random(-20, 20), translateY: () => anime.random(-20, 20), rotate: () => anime.random(-90, 90), duration: () => anime.random(5000, 6000), - delay: () => anime.random(0, 1000), direction: 'alternate', easing: 'linear', loop: true, diff --git a/server/src/skill.rs b/server/src/skill.rs index a11269ca..e04aa052 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -1378,6 +1378,12 @@ mod tests { _ => panic!("not siphon"), }; + let Resolution { source: _, target: _, event } = results.remove(0); + match event { + Event::Damage { amount, skill: _, mitigation: _, colour: _} => assert_eq!(amount, 256), + _ => panic!("not damage siphon"), + }; + let Resolution { source: _, target, event } = results.remove(0); match event { Event::Healing { amount, skill: _, overhealing: _ } => { @@ -1386,13 +1392,6 @@ mod tests { }, _ => panic!("not healing"), }; - - let Resolution { source: _, target: _, event } = results.remove(0); - match event { - Event::Damage { amount, skill: _, mitigation: _, colour: _} => assert_eq!(amount, 256), - _ => panic!("not damage siphon"), - }; - }