From e7aee86aae7e79cce3920f2e09c0b82080c9b950 Mon Sep 17 00:00:00 2001 From: Mashy Date: Wed, 27 Mar 2019 15:40:17 +1000 Subject: [PATCH] Added skill descriptions, cleaned up some scenes --- client/src/scenes/constants.js | 232 +++++++++++++++++++++------ client/src/scenes/home.navigation.js | 4 +- client/src/scenes/item.info.js | 35 +++- client/src/scenes/statsheet.js | 18 +-- 4 files changed, 221 insertions(+), 68 deletions(-) diff --git a/client/src/scenes/constants.js b/client/src/scenes/constants.js index c6734def..377a3b50 100644 --- a/client/src/scenes/constants.js +++ b/client/src/scenes/constants.js @@ -169,55 +169,187 @@ module.exports = { // chargeBall: [300, 500], }, - SKILLS: { - LEARNABLE: - [ { name: 'Amplify', - description: 'increase the magic damage dealt by a cryp' }, - { name: 'Attack', - description: 'a fast attack with red damage' }, - { name: 'Banish', - description: - 'target cryp is prevented from casting any skills and taking any damage' }, - { name: 'Blast', - description: 'blast the target with magic damage' }, - { name: 'Block', - description: 'decreases incoming red damage for 1T' }, - { name: 'Curse', - description: 'target cryp takes increased magic damage' }, - { name: 'Decay', - description: - 'afflict a cryp with a blue damage based damage over time debuff' }, - { name: 'Siphon', - description: 'siphon hp from target cryp with a blue damage based debuff' }, - { name: 'Empower', - description: 'increase the red damage dealt by a cryp' }, - { name: 'Haste', - description: 'magical skill that increases speed of target cryp' }, - { name: 'Heal', description: 'heal a cryp with blue damage' }, - { name: 'Hex', - description: - 'magical based skill that prevents target cryp from using any skills' }, - { name: 'Parry', - description: 'prevents all red damage for 1T' }, - { name: 'Purge', - description: 'remove magical buffs from target cryp' }, - { name: 'Purify', - description: 'remove magical debuffs from target cryp' }, - { name: 'Shield', - description: 'grants immunity to magical skills to target cryp' }, - { name: 'Silence', - description: 'prevent target cryp from casting magical skills' }, - { name: 'Slow', - description: 'magical skill that reduces speed of target cryp' }, - { name: 'Snare', - description: 'prevents red skills from being used for 2T' }, - { name: 'Stun', - description: - 'red skill that prevents target cryp from using any skills' }, - { name: 'Throw', - description: 'stuns and makes the target take increased red damage' }, - { name: 'Triage', - description: 'grants a blue damage based healing over time buff' } - ] + ITEMS: { + SKILLS: { + Amplify: { + description: 'increase the magic damage dealt by a cryp', + colours: '2 Blue', + }, + + Attack: { + description: 'a fast attack with red damage', + upgrades: 'combine with any combination of 2 red / blue / green - red + blue attack not implemented', + }, + + Banish: { + description: 'target cryp is prevented from casting any skills and taking any damage', + }, + + Blast: { + description: 'blast the target with magic damage', + }, + + Block: { + description: 'decreases incoming red damage for 1T', + upgrades: 'combine with any combination of 2 red / blue / green', + }, + + Buff: { + description: 'increase target cryp speed', + upgrades: 'combine with any combination of 2 red / blue / green', + }, + + Clutch: { + description: '??????', + }, + + Curse: { + description: 'target cryp takes increased magic damage', + }, + + Debuff: { + description: 'reduce target cryp speed', + upgrades: 'combine with any combination of 2 red / blue / green', + }, + + Decay: { + description: 'afflict a cryp with a blue damage based damage over time debuff', + }, + + Empower: { + description: 'increase the red damage dealt by a cryp', + }, + + Haste: { + description: 'magical skill that increases speed of target cryp', + }, + + Heal: { + description: 'heal a cryp with blue damage', + }, + + Hex: { + description: 'magical bsed skill that prevents target cryp from using any skills', + }, + + Hostility: { + description: 'magical bsed skill that prevents target cryp from using any skills', + }, + + Invert: { + description: 'reverse ???', + }, + + Parry: { + description: 'prevents all red damage for 1T', + }, + + Purge: { + description: 'remove magical buffs from target cryp', + }, + + Purify: { + description: 'remove magical debuffs from target cryp', + }, + + Recharge: { + description: 'restore something', + }, + + Reflect: { + description: 'reflect damage back to attacker', + }, + + Riposte: { + description: '???', + }, + + Ruin: { + description: 'Stun the entire enemy team', + }, + + Shield: { + description: 'grants immunity to magical skills to target cryp', + }, + + Silence: { + description: 'prevent target cryp from casting magical skills', + }, + + Siphon: { + description: 'siphon hp from target cryp with a blue damage based debuff', + }, + + Slay: { + description: '????', + }, + + Slow: { + description: 'magical skill that reduces speed of target cryp', + }, + + Snare: { + description: 'prevents red skills from being used for 2T', + }, + + Strangle: { + description: 'Stun the enemy and inflict physical damage over 3T', + }, + + Strike: { + description: 'Fast attacking red skill', + }, + + Stun: { + description: 'red skill hat prevents target cryp from using any skills', + upgrades: 'combine with any combination of 2 red / blue / green', + + }, + + Taunt: { + description: 'Enemy skills will prioritise cryps with this skill active', + }, + + Throw: { + description: 'stuns and makes the target take increased red damage', + }, + + Triage: { + description: 'grants a blue damage based healing over time buff', + }, + }, + + SPECS: { + Damage: { + description: 'Increase red / green / blue power stats cryp', + upgrades: 'combine with any combination of 2 red / blue / green', + + }, + + Hp: { + description: 'Increases health of cryp', + upgrades: 'combine with any combination of 2 red / blue / green', + + }, + + Speed: { + description: 'Increases speed of cryp', + upgrades: 'combine with any combination of 2 red / blue / green', + }, + }, + + COLOURS: { + Red: { + description: 'Used to create offensive type combos - fast and chaotic', + }, + + Green: { + description: 'Used to create defensive / healing type combos', + }, + + Blue: { + description: 'Used to create offensive type combos - slow and reliable', + }, + }, }, }; diff --git a/client/src/scenes/home.navigation.js b/client/src/scenes/home.navigation.js index 8f2249f1..40846df8 100644 --- a/client/src/scenes/home.navigation.js +++ b/client/src/scenes/home.navigation.js @@ -16,7 +16,7 @@ class HomeNavigation extends Phaser.Scene { } create() { - const ranks = this.add +/* const ranks = this.add .rectangle(X, Y, BTN_WIDTH, BTN_HEIGHT, 0x222222) .setInteractive() .setOrigin(0); @@ -50,7 +50,7 @@ class HomeNavigation extends Phaser.Scene { this.add .text(instances.getCenter().x, instances.getCenter().y, 'Instances', TEXT.HEADER) .setOrigin(0.5, 0.5); - instances.on('pointerdown', () => this.registry.set('homeInstances', true)); + instances.on('pointerdown', () => this.registry.set('homeInstances', true));*/ } cleanUp() { diff --git a/client/src/scenes/item.info.js b/client/src/scenes/item.info.js index a72d3492..c9cb8f22 100644 --- a/client/src/scenes/item.info.js +++ b/client/src/scenes/item.info.js @@ -1,5 +1,5 @@ const Phaser = require('phaser'); -const { POSITIONS: { MENU_MAIN }, TEXT } = require('./constants'); +const { POSITIONS: { MENU_MAIN }, TEXT, ITEMS: { SKILLS, SPECS, COLOURS } } = require('./constants'); const X = MENU_MAIN.x(); const Y = MENU_MAIN.y(); @@ -18,12 +18,39 @@ class ItemInfo extends Phaser.Scene { create(props) { const { item, cryp } = props; if (!item) return false; - this.add.text(X, Y, item, TEXT.HEADER); - this.add.text(X, Y + HEIGHT * 0.1, 'descriptions go here', TEXT.NORMAL); + + // Default item text + let title = item; + let description = 'Description missing'; + let upgrades = ''; + + // Replace item text with constants if it exists + if (SKILLS[item]) { + title = `Skill Item - ${item}`; + ({ description } = SKILLS[item]); + if (SKILLS[item].upgrades) ({ upgrades } = SKILLS[item]); + } else if (SPECS[item]) { + title = `Spec Item - ${item}`; + ({ description } = SPECS[item]); + if (SPECS[item].upgrades) ({ upgrades } = SPECS[item]); + } else if (COLOURS[item]) { + title = `Colour Item - ${item}`; + ({ description } = COLOURS[item]); + if (COLOURS[item].upgrades) ({ upgrades } = COLOURS[item]); + } + + // Add text objects + this.add.text(X, Y, title, TEXT.HEADER); + this.add + .text(X, Y + HEIGHT * 0.1, description, TEXT.NORMAL) + .setWordWrapWidth(WIDTH * 0.75); + this.add + .text(X, Y + HEIGHT * 0.25, upgrades, TEXT.NORMAL) + .setWordWrapWidth(WIDTH * 0.75); + if (!cryp) return true; const ws = this.registry.get('ws'); const { vbox } = this.registry.get('player'); - const unEquip = this.add.rectangle(X, UNEQUIP_Y, UNEQUIP_WIDTH, UNEQUIP_HEIGHT, 0x222222) .setOrigin(0, 0) .setInteractive() diff --git a/client/src/scenes/statsheet.js b/client/src/scenes/statsheet.js index ebf12cc3..e7116f56 100644 --- a/client/src/scenes/statsheet.js +++ b/client/src/scenes/statsheet.js @@ -54,17 +54,19 @@ class StatSheet extends Phaser.Scene { create(cryp) { this.registry.events.on('changedata', this.updateData, this); - const ws = this.registry.get('ws'); + // const ws = this.registry.get('ws'); const player = this.registry.get('player'); if (!player) return false; - const { vbox } = player; + // const { vbox } = player; this.cryp = cryp; + /* const del = this.add.existing(new DeleteHitBox(this, X + WIDTH * 0.7, Y + HEIGHT * 0.6)); this.add.text(del.getCenter().x, del.getCenter().y, 'unequip', TEXT.HEADER) .setOrigin(0.5, 0.5); + */ this.add.text(X, Y, cryp.name, TEXT.HEADER); @@ -85,6 +87,7 @@ class StatSheet extends Phaser.Scene { ]; CRYP_STATS.forEach(crypStat); + /* const knownSkill = (skill, i) => { const SKILL_X = X + WIDTH * 0.4 + WIDTH * 0.125 * i; const SKILL_Y = Y + HEIGHT * 0.15; @@ -127,19 +130,10 @@ class StatSheet extends Phaser.Scene { } return true; }); + */ return this; } - displaySkillText(x, y, description, pointer) { - if (this.skillText) this.skillText.destroy(); - this.skillText = this.add.text(x, y, description, TEXT.HOVER).setPadding(32); - this.skillText.setAlpha(0.8); - this.skillText.setOrigin(pointer.x >= WIDTH * 0.65 ? 1 : 0, - pointer.y >= HEIGHT * 0.25 ? 1 : 0); - this.skillText.setWordWrapWidth(450); - } - - cleanUp() { this.registry.events.off('changedata', this.updateData, this); this.scene.remove();