misc fixes

This commit is contained in:
Mashy 2019-07-01 21:23:13 +10:00
parent 81970f5abf
commit 9e5a612739
4 changed files with 5 additions and 17 deletions

View File

@ -29,17 +29,15 @@ function createSocket(store) {
if (['Disable', 'TargetKo'].includes(r.event[0])) return cb();
// Create sub events for combat animations
const sequence = getCombatSequence(r);
console.log(sequence);
return eachSeries(sequence, (stages, sCb) => {
const stagedR = Object.create(r);
stagedR.stages = stages;
let timeout = 0;
if (stages.includes('START_SKILL') && stages.includes('END_SKILL')) {
timeout = (TIMES.SOURCE_DURATION_MS + TIMES.TARGET_DURATION_MS - TIMES.TARGET_DELAY_MS);
timeout = (TIMES.TARGET_DURATION_MS + TIMES.TARGET_DELAY_MS);
} 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));
return setTimeout(sCb, timeout);

View File

@ -40,13 +40,11 @@ const SOURCE_ANIM_MS = 850;
function animations(props) {
const { game, account, resolution, player, construct } = props;
console.log(resolution);
if (!resolution) return false;
const [, event] = resolution.event;
if (!event.skill) return false;
if (!resolution.target) return false;
const { stages } = resolution;
console.log(stages);
// source animation
if (resolution.source.id === construct.id && stages.includes('START_SKILL')) {
@ -89,7 +87,6 @@ function animations(props) {
if (resolution.target.id !== construct.id) return false;
// target animation
console.log(stages);
const anim = text => {
console.log(text);
if (!text || !stages.includes('END_SKILL')) return false;

View File

@ -2,8 +2,7 @@ const { connect } = require('preact-redux');
const preact = require('preact');
const range = require('lodash/range');
const actions = require('../actions');
const { STATS, eventClasses, getCombatText } = require('../utils');
const { STATS, eventClasses } = require('../utils');
const { ConstructAvatar } = require('./construct');
const animations = require('./animations');
const shapes = require('./shapes');

View File

@ -1,15 +1,9 @@
module.exports = {
TIMES: {
<<<<<<< HEAD
=======
RESOLUTION_TOTAL_MS: 2000,
// RESOLUTION_TOTAL_MS: 200000,
>>>>>>> anims-change
SOURCE_DURATION_MS: 1000,
TARGET_DELAY_MS: 500,
TARGET_DURATION_MS: 1000,
POST_SKILL_DURATION_MS: 750,
TARGET_DELAY_MS: 700,
TARGET_DURATION_MS: 1300,
POST_SKILL_DURATION_MS: 1000,
},
COLOURS: {