keep anims going during post skill text
This commit is contained in:
parent
3e8634e6c7
commit
baeb90f91a
@ -31,7 +31,9 @@ function createSocket(store) {
|
|||||||
const sequence = getCombatSequence(r);
|
const sequence = getCombatSequence(r);
|
||||||
return eachSeries(sequence, (stages, sCb) => {
|
return eachSeries(sequence, (stages, sCb) => {
|
||||||
const stagedR = Object.create(r);
|
const stagedR = Object.create(r);
|
||||||
|
stagedR.sequence = sequence;
|
||||||
stagedR.stages = stages;
|
stagedR.stages = stages;
|
||||||
|
|
||||||
let timeout = 0;
|
let timeout = 0;
|
||||||
if (stages.includes('START_SKILL') && stages.includes('END_SKILL')) {
|
if (stages.includes('START_SKILL') && stages.includes('END_SKILL')) {
|
||||||
timeout = (TIMES.TARGET_DURATION_MS + TIMES.TARGET_DELAY_MS);
|
timeout = (TIMES.TARGET_DURATION_MS + TIMES.TARGET_DELAY_MS);
|
||||||
|
|||||||
@ -36,7 +36,7 @@ const colours = {
|
|||||||
white: '#FFFFFF',
|
white: '#FFFFFF',
|
||||||
};
|
};
|
||||||
|
|
||||||
const SOURCE_ANIM_MS = 850;
|
const { TIMES } = require('../constants');
|
||||||
|
|
||||||
function animations(props) {
|
function animations(props) {
|
||||||
const { game, account, resolution, player, construct } = props;
|
const { game, account, resolution, player, construct } = props;
|
||||||
@ -44,10 +44,9 @@ function animations(props) {
|
|||||||
const [, event] = resolution.event;
|
const [, event] = resolution.event;
|
||||||
if (!event.skill) return false;
|
if (!event.skill) return false;
|
||||||
if (!resolution.target) return false;
|
if (!resolution.target) return false;
|
||||||
const { stages } = resolution;
|
|
||||||
|
|
||||||
// source animation
|
// source animation
|
||||||
if (resolution.source.id === construct.id && stages.includes('START_SKILL')) {
|
if (resolution.source.id === construct.id && resolution.stages.includes('START_SKILL')) {
|
||||||
const playerTeam = game.players.find(t => t.id === account.id);
|
const playerTeam = game.players.find(t => t.id === account.id);
|
||||||
const playerTeamIds = playerTeam.constructs.map(c => c.id);
|
const playerTeamIds = playerTeam.constructs.map(c => c.id);
|
||||||
const otherTeam = game.players.find(t => t.id !== account.id);
|
const otherTeam = game.players.find(t => t.id !== account.id);
|
||||||
@ -73,14 +72,14 @@ function animations(props) {
|
|||||||
: otherTeamIds.findIndex(c => c === resolution.target.id);
|
: otherTeamIds.findIndex(c => c === resolution.target.id);
|
||||||
|
|
||||||
const x = j - i;
|
const x = j - i;
|
||||||
|
|
||||||
anime({
|
anime({
|
||||||
targets: [document.getElementById(construct.id)],
|
targets: [document.getElementById(construct.id)],
|
||||||
translateY: y * 200,
|
translateY: y * 200,
|
||||||
translateX: x * 200,
|
translateX: x * 200,
|
||||||
easing: 'easeInOutElastic',
|
easing: 'easeInOutElastic',
|
||||||
direction: 'alternate',
|
direction: 'alternate',
|
||||||
duration: SOURCE_ANIM_MS,
|
duration: TIMES.SOURCE_DURATION_MS,
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +88,7 @@ function animations(props) {
|
|||||||
// target animation
|
// target animation
|
||||||
const anim = text => {
|
const anim = text => {
|
||||||
console.log(text);
|
console.log(text);
|
||||||
if (!text || !stages.includes('END_SKILL')) return false;
|
if (!text || !resolution.sequence[0].includes('END_SKILL')) return false;
|
||||||
const skill = removeTier(text);
|
const skill = removeTier(text);
|
||||||
|
|
||||||
// if (skill === 'Bash' && type === 'Damage') return false;
|
// if (skill === 'Bash' && type === 'Damage') return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user