events code from anims
This commit is contained in:
parent
bd104b65b2
commit
2fcbd24495
@ -34,14 +34,14 @@ class Purify extends Component {
|
|||||||
this.charges = points.map(coord => projectile(coord[0], coord[1], 12, COLOURS.GREEN));
|
this.charges = points.map(coord => projectile(coord[0], coord[1], 12, COLOURS.GREEN));
|
||||||
}
|
}
|
||||||
|
|
||||||
render({ team }) {
|
render() {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
class='skill-animation green'
|
class='skill-animation green'
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="purify"
|
id="purify"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
style={{ transform: team ? 'rotate3d(1, 0, 0, 180deg)' : '' }}
|
style={{ transform: 'rotate3d(1, 0, 0, 180deg)' }}
|
||||||
viewBox="0 0 256 256">
|
viewBox="0 0 256 256">
|
||||||
<filter id='purifyFilter'>
|
<filter id='purifyFilter'>
|
||||||
<feGaussianBlur stdDeviation="3"/>
|
<feGaussianBlur stdDeviation="3"/>
|
||||||
|
|||||||
@ -50,7 +50,6 @@ function registerEvents(store) {
|
|||||||
const { game: currentGame, ws } = store.getState();
|
const { game: currentGame, ws } = store.getState();
|
||||||
|
|
||||||
if (game) ws.startGameStateTimeout(game.id);
|
if (game) ws.startGameStateTimeout(game.id);
|
||||||
console.log(JSON.stringify(game))
|
|
||||||
if (game && currentGame) {
|
if (game && currentGame) {
|
||||||
if (game.resolved.length !== currentGame.resolved.length) {
|
if (game.resolved.length !== currentGame.resolved.length) {
|
||||||
// stop fetching the game state til animations are done
|
// stop fetching the game state til animations are done
|
||||||
@ -60,14 +59,20 @@ function registerEvents(store) {
|
|||||||
if (['Disable', 'TargetKo'].includes(r.event[0])) return cb();
|
if (['Disable', 'TargetKo'].includes(r.event[0])) return cb();
|
||||||
// Create sub events for combat animations
|
// Create sub events for combat animations
|
||||||
const sequence = getCombatSequence(r);
|
const sequence = getCombatSequence(r);
|
||||||
return eachSeries(sequence, (stage, sCb) => {
|
return eachSeries(sequence, (stages, sCb) => {
|
||||||
const { skip } = store.getState();
|
|
||||||
if (skip) return sCb('skip');
|
|
||||||
const stagedR = Object.create(r);
|
const stagedR = Object.create(r);
|
||||||
stagedR.stage = stage;
|
stagedR.sequence = sequence;
|
||||||
|
stagedR.stages = stages;
|
||||||
|
|
||||||
|
let timeout = 0;
|
||||||
|
if (stages.includes('START_SKILL') && stages.includes('END_SKILL')) {
|
||||||
|
timeout = TIMES.SOURCE_AND_TARGET_TOTAL_DURATION;
|
||||||
|
} else if (stages.includes('START_SKILL')) timeout = TIMES.SOURCE_DURATION_MS;
|
||||||
|
else if (stages.includes('END_SKILL')) timeout = TIMES.TARGET_DURATION_MS;
|
||||||
|
else if (stages.includes('POST_SKILL')) timeout = TIMES.POST_SKILL_DURATION_MS;
|
||||||
store.dispatch(actions.setResolution(stagedR));
|
store.dispatch(actions.setResolution(stagedR));
|
||||||
|
|
||||||
return setTimeout(sCb, TIMES[stage]);
|
return setTimeout(sCb, timeout);
|
||||||
}, err => {
|
}, err => {
|
||||||
if (err) console.error(err);
|
if (err) console.error(err);
|
||||||
// Finished this resolution
|
// Finished this resolution
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user