diff --git a/client/src/scenes/combat.cryps.js b/client/src/scenes/combat.cryps.js index 49b8ab22..26452ae4 100755 --- a/client/src/scenes/combat.cryps.js +++ b/client/src/scenes/combat.cryps.js @@ -173,20 +173,21 @@ class CombatCryps extends Phaser.GameObjects.Group { this.scene = scene; } - update(game, createCryps) { + update(game) { // Setting gamePhase will stop redraw unless phase changes again - if (!createCryps) this.clearSkills(); + this.clearSkills(); + // Destroy skills currently shown as the game state has changed const account = this.scene.registry.get('account'); const allyTeam = game.teams.find(t => t.id === account.id); // in future there will be more than one const [enemyTeam] = game.teams.filter(t => t.id !== account.id); const renderTeam = (cryp, iter, team) => { - const crypObj = createCryps - ? renderCryp(this.scene, this, cryp, game, team, iter) - : this.children.entries + const crypObj = + this.children.entries .filter(obj => obj instanceof CrypImage) - .find(c => c.cryp.id === cryp.id); + .find(c => c.cryp.id === cryp.id) + || renderCryp(this.scene, this, cryp, game, team, iter); // Update to health bars wont be needed when dmg taken is done properly crypObj.healthbar.hp = cryp.hp.base; crypObj.healthbar.drawHealthBar(); diff --git a/client/src/scenes/combat.js b/client/src/scenes/combat.js index 4471fc1f..bd6bb86b 100755 --- a/client/src/scenes/combat.js +++ b/client/src/scenes/combat.js @@ -63,7 +63,7 @@ class Combat extends Phaser.Scene { startGame(game) { this.renderedResolves = game.resolved.length; // In case you rejoin mid way this.combatCryps = new CombatCryps(this); - this.combatCryps.update(game, true); + this.combatCryps.update(game); this.registry.set('gamePhase', game.phase); return true; } @@ -109,7 +109,7 @@ class Combat extends Phaser.Scene { const phaseChange = (this.registry.get('gamePhase') === game.phase); if (phaseChange) return false; this.registry.set('gamePhase', game.phase); - this.combatCryps.update(game, false); + this.combatCryps.update(game); // Game over? diff --git a/client/src/socket.js b/client/src/socket.js index c6b42b79..e94276d2 100644 --- a/client/src/socket.js +++ b/client/src/socket.js @@ -185,9 +185,9 @@ function createSocket(events) { }); if (!account) events.loginPrompt(); - if (process.env.NODE_ENV !== 'production') { - send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } }); - } + // if (process.env.NODE_ENV !== 'production') { + // send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } }); + // } return true; }); diff --git a/server/WORKLOG.md b/server/WORKLOG.md index b7953b44..611f1662 100644 --- a/server/WORKLOG.md +++ b/server/WORKLOG.md @@ -11,6 +11,8 @@ * notifications +* rejoin in progress games + * skills * check cryp status when resolving skills * ko / stun / silence etc prevent effect