diff --git a/client/src/scenes/constants.js b/client/src/scenes/constants.js new file mode 100644 index 00000000..e7603cb1 --- /dev/null +++ b/client/src/scenes/constants.js @@ -0,0 +1,82 @@ +module.exports = { + TEXT: { + NORMAL: { fontFamily: 'monospace', fontSize: 16, color: '#ffffff' }, + HEADER: { fontFamily: 'monospace', fontSize: 24, color: '#ffffff', fontStyle: 'bold' }, + }, + + SKILLS: { + LEARNABLE: [ + 'Attack', + + // ----------------- + // Nature + // ----------------- + 'Block', // reduce dmg + 'Parry', // avoid all dmg + 'Snare', + + // 'Paralyse', + + 'Strangle', // physical dot and disable + + 'Stun', + 'Evade', // actively evade + 'Evasion', // adds evasion to cryp + + + // ----------------- + // Technology + // ----------------- + // 'Replicate', + // 'Swarm', + // 'Orbit', + // 'Repair', + // 'Scan', // track? + + // ----------------- + // Nonviolence + // ----------------- + 'Heal', + 'Triage', // hot + // 'TriageTick', + 'Throw', // no dmg stun', adds vulnerable + 'Charm', + 'Calm', + 'Rez', + + // ------------------- + // Destruction + // ------------------- + 'Blast', + 'Amplify', + 'Decay', // dot + // 'DecayTick', // dot + 'Drain', + // 'DrainTick', + 'Curse', + 'Plague', // aoe dot + 'Ruin', // aoe + + // ----------------- + // Purity + // ----------------- + 'Empower', + 'Slay', + 'Shield', + 'Silence', + 'Inquiry', + 'Purify', + 'Purge', + // '// Precision', + + // ----------------- + // Chaos + // ----------------- + 'Banish', + 'Hex', + 'Fear', + 'Taunt', + 'Pause', // speed slow + ], + }, +}; diff --git a/client/src/scenes/cryp.list.js b/client/src/scenes/cryp.list.js old mode 100644 new mode 100755 index 6eb901cd..12430ad6 --- a/client/src/scenes/cryp.list.js +++ b/client/src/scenes/cryp.list.js @@ -34,7 +34,6 @@ class CrypList extends Phaser.Scene { crypRow(this, cryp, i); }); - window.redraw = this.redraw.bind(this); return true; } diff --git a/client/src/scenes/cryp.row.js b/client/src/scenes/cryp.row.js old mode 100644 new mode 100755 index e35320f2..2840ffcf --- a/client/src/scenes/cryp.row.js +++ b/client/src/scenes/cryp.row.js @@ -14,7 +14,6 @@ const xPos = i => 0; const yPos = i => (i * ROW_HEIGHT + ROW_MARGIN) + TOP_MARGIN; function crypRow(list, cryp, i) { - console.log(i); const X_ORIGIN = xPos(i); const Y_ORIGIN = yPos(i); diff --git a/client/src/scenes/cryps.js b/client/src/scenes/cryps.js old mode 100644 new mode 100755 index b62173bb..1d6d11bf --- a/client/src/scenes/cryps.js +++ b/client/src/scenes/cryps.js @@ -3,6 +3,7 @@ const Phaser = require('phaser'); const CrypList = require('./cryp.list'); const CrypPage = require('./cryp.page'); const Menu = require('./menu'); +const Passives = require('./passives'); // const Passives = require('./passives'); function renderCryps(store, socket) { @@ -24,6 +25,7 @@ function renderCryps(store, socket) { Menu, CrypList, CrypPage, + Passives, ], }; @@ -34,7 +36,8 @@ function renderCryps(store, socket) { game.registry.set('cryps', state.cryps); game.registry.set('ws', state.ws); }); - + window.addEventListener('mouseup', () => game.registry.set('pan', false)); + window.addEventListener('mousedown', () => game.registry.set('pan', true)); window.addEventListener('resize', () => game.resize(window.innerWidth, window.innerHeight), false); return game; diff --git a/client/src/scenes/menu.js b/client/src/scenes/menu.js old mode 100644 new mode 100755 index beaf4fc2..fa84c9b1 --- a/client/src/scenes/menu.js +++ b/client/src/scenes/menu.js @@ -8,7 +8,15 @@ class Menu extends Phaser.Scene { } create() { +<<<<<<< HEAD this.add.text(0, 0, 'cryps.gg', TEXT.HEADER); +======= + this.scene.sleep('Passives'); + this.add.text(0, 0, 'cryps.gg', { fontFamily: 'Arial', fontSize: 24, color: '#ffffff', fontStyle: 'bold' }); + this.input.keyboard.on('keydown_F', () => { + this.scene.wake('Passives'); + }, 0, this); +>>>>>>> ab0aebc49f285e1f0a71035790e3089eadce25f2 } } diff --git a/client/src/scenes/passives.js b/client/src/scenes/passives.js index 6d4bade1..94fffeb0 100755 --- a/client/src/scenes/passives.js +++ b/client/src/scenes/passives.js @@ -9,7 +9,7 @@ const passiveDataEdge = require('./passive.data.edge'); class PhaserPassives extends Phaser.Scene { constructor() { - super('passives'); + super({ key: 'Passives', active: true }); } preload() { @@ -73,7 +73,7 @@ class PhaserPassives extends Phaser.Scene { }); this.input.on('pointermove', (pointer) => { const zoomFactor = 2 / this.cameras.main.zoom; - if (this.pan) { + if (this.registry.get('pan')) { const points = pointer.getInterpolatedPosition(2); this.cameras.main.scrollX -= zoomFactor * (points[1].x - points[0].x); this.cameras.main.scrollY -= zoomFactor * (points[1].y - points[0].y); @@ -82,8 +82,8 @@ class PhaserPassives extends Phaser.Scene { this.input.keyboard.on('keydown_A', () => { this.updatePassives(); // Will update nodes from state }, 0, this); - this.input.keyboard.on('keydown_S', () => { - this.scene.switch('combat'); + this.input.keyboard.on('keydown_G', () => { + this.scene.sleep('Passives'); }, 0, this); } @@ -98,7 +98,6 @@ class PhaserPassives extends Phaser.Scene { } else { this.graphics.lineStyle(2, 0xffffff, 0.2); } - // console.log(drawEdge); this.graphics.lineBetween(drawEdge[0].x, drawEdge[0].y, drawEdge[1].x, drawEdge[1].y); }); }