Merge branch 'anims-change' of ssh://mnml.gg:40022/~/mnml into anims-change
This commit is contained in:
commit
471f277b4e
@ -31,7 +31,9 @@ function createSocket(store) {
|
||||
const sequence = getCombatSequence(r);
|
||||
return eachSeries(sequence, (stages, sCb) => {
|
||||
const stagedR = Object.create(r);
|
||||
stagedR.sequence = sequence;
|
||||
stagedR.stages = stages;
|
||||
|
||||
let timeout = 0;
|
||||
if (stages.includes('START_SKILL') && stages.includes('END_SKILL')) {
|
||||
timeout = (TIMES.TARGET_DURATION_MS + TIMES.TARGET_DELAY_MS);
|
||||
|
||||
@ -37,7 +37,7 @@ const colours = {
|
||||
white: '#FFFFFF',
|
||||
};
|
||||
|
||||
const SOURCE_ANIM_MS = 850;
|
||||
const { TIMES } = require('../constants');
|
||||
|
||||
function animations(props) {
|
||||
const { game, account, resolution, player, construct } = props;
|
||||
@ -45,10 +45,9 @@ function animations(props) {
|
||||
const [, event] = resolution.event;
|
||||
if (!event.skill) return false;
|
||||
if (!resolution.target) return false;
|
||||
const { stages } = resolution;
|
||||
|
||||
// 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 playerTeamIds = playerTeam.constructs.map(c => c.id);
|
||||
const otherTeam = game.players.find(t => t.id !== account.id);
|
||||
@ -74,14 +73,14 @@ function animations(props) {
|
||||
: otherTeamIds.findIndex(c => c === resolution.target.id);
|
||||
|
||||
const x = j - i;
|
||||
|
||||
anime({
|
||||
targets: [document.getElementById(construct.id)],
|
||||
translateY: y * 200,
|
||||
translateX: x * 200,
|
||||
easing: 'easeInOutElastic',
|
||||
direction: 'alternate',
|
||||
duration: SOURCE_ANIM_MS,
|
||||
duration: TIMES.SOURCE_DURATION_MS,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -90,7 +89,7 @@ function animations(props) {
|
||||
// target animation
|
||||
const anim = 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);
|
||||
|
||||
// if (skill === 'Bash' && type === 'Damage') return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user