remove team check fixed scene swap
This commit is contained in:
parent
8df814d1a6
commit
681b9dab4e
14
client/src/events.js
Normal file → Executable file
14
client/src/events.js
Normal file → Executable file
@ -42,20 +42,22 @@ function registerEvents(registry, events) {
|
|||||||
events.on('SEND_ACTIVE_SKILL', function skillActive(cryp) {
|
events.on('SEND_ACTIVE_SKILL', function skillActive(cryp) {
|
||||||
const activeSkill = registry.get('activeSkill');
|
const activeSkill = registry.get('activeSkill');
|
||||||
const game = registry.get('game');
|
const game = registry.get('game');
|
||||||
if (activeSkill) {
|
|
||||||
const target = activeSkill.cryp.account === cryp.account;
|
|
||||||
if (!target) {
|
|
||||||
const ws = registry.get('ws');
|
const ws = registry.get('ws');
|
||||||
|
if (activeSkill) {
|
||||||
|
// const friendlyTarget = activeSkill.cryp.account === cryp.account;
|
||||||
|
// if (!friendlyTarget) {
|
||||||
if (game.phase === 'Skill') {
|
if (game.phase === 'Skill') {
|
||||||
ws.sendGameSkill(game.id, activeSkill.cryp.id, cryp.account, activeSkill.skill.skill);
|
ws.sendGameSkill(game.id, activeSkill.cryp.id, cryp.account, activeSkill.skill.skill);
|
||||||
} else if (game.phase === 'Target') {
|
} else if (game.phase === 'Target') {
|
||||||
ws.sendGameTarget(game.id, cryp.id, activeSkill.skill.id);
|
ws.sendGameTarget(game.id, cryp.id, activeSkill.skill.id);
|
||||||
}
|
}
|
||||||
activeSkill.setTint(0xff0000);
|
activeSkill.setTint(0xff0000);
|
||||||
} else {
|
|
||||||
activeSkill.clearTint();
|
|
||||||
}
|
|
||||||
registry.set('activeSkill', null);
|
registry.set('activeSkill', null);
|
||||||
|
// } else if (friendlyTarget && activeSkill.skill.self_targeting) {
|
||||||
|
// ws.sendGameSkill(game.id, activeSkill.cryp.id, null, activeSkill.skill.skill);
|
||||||
|
// } else {
|
||||||
|
// activeSkill.clearTint();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -104,10 +104,7 @@ class Combat extends Phaser.Scene {
|
|||||||
}
|
}
|
||||||
// update log
|
// update log
|
||||||
// shallow copy because reverse mutates
|
// shallow copy because reverse mutates
|
||||||
const content = Array.from(game.log).reverse().join('\n');
|
this.log.setText(Array.from(game.log).reverse());
|
||||||
// this.log.setText(Array.from(game.log).reverse());
|
|
||||||
console.log(this.log);
|
|
||||||
this.log.setText(content);
|
|
||||||
// has the phase changed?
|
// has the phase changed?
|
||||||
const phaseChange = (this.registry.get('gamePhase') === game.phase);
|
const phaseChange = (this.registry.get('gamePhase') === game.phase);
|
||||||
if (phaseChange) return false;
|
if (phaseChange) return false;
|
||||||
|
|||||||
@ -11,8 +11,14 @@ class CrypList extends Phaser.Scene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
this.registry.events.off('changedata', this.updateData, this);
|
||||||
|
this.registry.events.off('setdata', this.updateData, this);
|
||||||
this.registry.events.on('changedata', this.updateData, this);
|
this.registry.events.on('changedata', this.updateData, this);
|
||||||
this.registry.events.on('setdata', this.updateData, this);
|
this.registry.events.on('setdata', this.updateData, this);
|
||||||
|
if (this.registry.get('cryps')) {
|
||||||
|
this.renderList();
|
||||||
|
this.renderGameList();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +66,7 @@ class CrypList extends Phaser.Scene {
|
|||||||
if (cryp) {
|
if (cryp) {
|
||||||
this.scene.add('StatSheet', StatSheet);
|
this.scene.add('StatSheet', StatSheet);
|
||||||
this.scene.run('StatSheet', { cryp });
|
this.scene.run('StatSheet', { cryp });
|
||||||
this.scene.sleep();
|
this.scene.stop();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,8 @@ class StatSheet extends Phaser.Scene {
|
|||||||
this.cryp = cryp;
|
this.cryp = cryp;
|
||||||
this.stats = new Stats(this, cryp);
|
this.stats = new Stats(this, cryp);
|
||||||
this.addControls(cryp);
|
this.addControls(cryp);
|
||||||
|
this.addSkills(cryp);
|
||||||
|
this.skills = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
addControls(cryp) {
|
addControls(cryp) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user