cryp animations
This commit is contained in:
parent
a970f5256e
commit
f93aba866f
@ -12,6 +12,8 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"anime": "^0.1.2",
|
||||||
|
"animejs": "^3.0.1",
|
||||||
"async": "^2.6.2",
|
"async": "^2.6.2",
|
||||||
"borc": "^2.0.3",
|
"borc": "^2.0.3",
|
||||||
"bulma-toast": "^1.2.0",
|
"bulma-toast": "^1.2.0",
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
const toast = require('izitoast');
|
const toast = require('izitoast');
|
||||||
const eachSeries = require('async/eachSeries');
|
const eachSeries = require('async/eachSeries');
|
||||||
|
const anime = require('animejs').default;
|
||||||
|
const range = require('lodash/range');
|
||||||
|
|
||||||
const actions = require('./actions');
|
const actions = require('./actions');
|
||||||
const { TIMES } = require('./constants');
|
const { TIMES } = require('./constants');
|
||||||
@ -9,12 +11,30 @@ function registerEvents(store) {
|
|||||||
|
|
||||||
// timeout handlers
|
// timeout handlers
|
||||||
store.subscribe(() => {
|
store.subscribe(() => {
|
||||||
const { game, instance, ws} = store.getState();
|
const { game, instance, cryps, ws} = store.getState();
|
||||||
|
|
||||||
if (!game) ws.clearGameStateTimeout();
|
if (!game) ws.clearGameStateTimeout();
|
||||||
if (!instance) ws.clearInstanceStateTimeout();
|
if (!instance) ws.clearInstanceStateTimeout();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// cryp animations
|
||||||
|
function crypAnimations() {
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setInterval(crypAnimations, 5000);
|
||||||
|
crypAnimations();
|
||||||
|
|
||||||
function setCryps(cryps) {
|
function setCryps(cryps) {
|
||||||
console.log('EVENT ->', 'cryps', cryps);
|
console.log('EVENT ->', 'cryps', cryps);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1137,13 +1137,12 @@ fn siphon_tick(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, s
|
|||||||
let siphon_events = target.deal_blue_damage(Skill::SiphonTick, amount);
|
let siphon_events = target.deal_blue_damage(Skill::SiphonTick, amount);
|
||||||
|
|
||||||
for e in siphon_events {
|
for e in siphon_events {
|
||||||
results.push(Resolution::new(source, target).event(e));
|
|
||||||
|
|
||||||
match e {
|
match e {
|
||||||
Event::Damage { amount, mitigation: _, colour: _, skill: _ } => {
|
Event::Damage { amount, mitigation: _, colour: _, skill: _ } => {
|
||||||
|
results.push(Resolution::new(source, target).event(e));
|
||||||
let heal = source.deal_green_damage(Skill::Siphon, amount);
|
let heal = source.deal_green_damage(Skill::Siphon, amount);
|
||||||
for e in heal {
|
for h in heal {
|
||||||
results.push(Resolution::new(source, source).event(e));
|
results.push(Resolution::new(source, source).event(h));
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
_ => (),
|
_ => (),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user