Merge branch 'master' of ssh://cryps.gg:40022/~/cryps
This commit is contained in:
commit
6892a58341
@ -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();
|
||||
|
||||
@ -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?
|
||||
|
||||
@ -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;
|
||||
});
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
|
||||
* notifications
|
||||
|
||||
* rejoin in progress games
|
||||
|
||||
* skills
|
||||
* check cryp status when resolving skills
|
||||
* ko / stun / silence etc prevent effect
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user