Merge branch 'zones'

This commit is contained in:
Mashy
2018-12-28 15:53:29 +10:00
7 changed files with 177 additions and 8 deletions
@@ -44,8 +44,6 @@ function calculateTweenParams(sourceSpawn, targetSpawn, account) {
}
function animatePhase(scene, game, resolution, cb) {
console.log(resolution);
// return early for disabled skills
if (resolution.resolution.disable.disabled) return cb();
const group = scene.scene.get('CombatCryps').cryps;
@@ -73,7 +71,7 @@ function animatePhase(scene, game, resolution, cb) {
if (moveSourceBattle) scene.tweens.add(moveSourceBattle);
scene.tweens.add(moveTargetBattle);
scene.time.delayedCall(MOVE_CREEP, () => {
return scene.time.delayedCall(MOVE_CREEP, () => {
const isAlly = resolution.target_team_id !== account.id;
// animate animation
const workingSkills = ['Heal', 'Block'];
+4 -4
View File
@@ -65,13 +65,13 @@ class MenuGameList extends Phaser.Scene {
.text(pve.getCenter().x, pve.getCenter().y, 'new PVE\ngame', TEXT.HEADER)
.setOrigin(0.5, 0.5));
const boss = this.add
const zones = this.add
.rectangle(X + WIDTH * 2, GAME_LIST.y(0), WIDTH, HEIGHT, 0x222222)
.setInteractive()
.setOrigin(0);
this.gameList.add(this.add
.text(boss.getCenter().x, boss.getCenter().y, 'MISSIONS\n', TEXT.HEADER)
.text(zones.getCenter().x, zones.getCenter().y, 'Zones\n', TEXT.HEADER)
.setOrigin(0.5, 0.5));
@@ -122,9 +122,9 @@ class MenuGameList extends Phaser.Scene {
return ws.sendGamePve(team, 'Normal');
});
boss.on('pointerdown', () => {
const team = cryps.filter(c => c.active).map(c => c.id);
zones.on('pointerdown', () => {
this.scene.add('Missions', Missions, true);
return ws.sendZoneCreate();
});
+7
View File
@@ -100,6 +100,11 @@ function createSocket(events) {
send({ method: 'item_use', params: { item, target } });
}
function sendZoneCreate() {
send({ method: 'zone_create', params: {} });
}
// -------------
// Incoming
// -------------
@@ -157,6 +162,7 @@ function createSocket(events) {
account_create: accountLogin,
account_cryps: accountCryps,
account_items: accountItems,
zone_create: res => console.log(res),
};
// decodes the cbor and
@@ -232,6 +238,7 @@ function createSocket(events) {
sendCrypLearn,
sendCrypForget,
sendItemUse,
sendZoneCreate,
connect,
};
}