Added skill descriptions, cleaned up some scenes

This commit is contained in:
Mashy 2019-03-27 15:40:17 +10:00
parent d4c43ce50f
commit e7aee86aae
4 changed files with 221 additions and 68 deletions

View File

@ -169,55 +169,187 @@ module.exports = {
// chargeBall: [300, 500], // chargeBall: [300, 500],
}, },
ITEMS: {
SKILLS: { SKILLS: {
LEARNABLE: Amplify: {
[ { name: 'Amplify', description: 'increase the magic damage dealt by a cryp',
description: 'increase the magic damage dealt by a cryp' }, colours: '2 Blue',
{ name: 'Attack', },
description: 'a fast attack with red damage' },
{ name: 'Banish', Attack: {
description: description: 'a fast attack with red damage',
'target cryp is prevented from casting any skills and taking any damage' }, upgrades: 'combine with any combination of 2 red / blue / green - red + blue attack not implemented',
{ name: 'Blast', },
description: 'blast the target with magic damage' },
{ name: 'Block', Banish: {
description: 'decreases incoming red damage for 1T' }, description: 'target cryp is prevented from casting any skills and taking any damage',
{ name: 'Curse', },
description: 'target cryp takes increased magic damage' },
{ name: 'Decay', Blast: {
description: description: 'blast the target with magic damage',
'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' }, Block: {
{ name: 'Empower', description: 'decreases incoming red damage for 1T',
description: 'increase the red damage dealt by a cryp' }, upgrades: 'combine with any combination of 2 red / blue / green',
{ name: 'Haste', },
description: 'magical skill that increases speed of target cryp' },
{ name: 'Heal', description: 'heal a cryp with blue damage' }, Buff: {
{ name: 'Hex', description: 'increase target cryp speed',
description: upgrades: 'combine with any combination of 2 red / blue / green',
'magical based skill that prevents target cryp from using any skills' }, },
{ name: 'Parry',
description: 'prevents all red damage for 1T' }, Clutch: {
{ name: 'Purge', description: '??????',
description: 'remove magical buffs from target cryp' }, },
{ name: 'Purify',
description: 'remove magical debuffs from target cryp' }, Curse: {
{ name: 'Shield', description: 'target cryp takes increased magic damage',
description: 'grants immunity to magical skills to target cryp' }, },
{ name: 'Silence',
description: 'prevent target cryp from casting magical skills' }, Debuff: {
{ name: 'Slow', description: 'reduce target cryp speed',
description: 'magical skill that reduces speed of target cryp' }, upgrades: 'combine with any combination of 2 red / blue / green',
{ name: 'Snare', },
description: 'prevents red skills from being used for 2T' },
{ name: 'Stun', Decay: {
description: description: 'afflict a cryp with a blue damage based damage over time debuff',
'red skill that prevents target cryp from using any skills' }, },
{ name: 'Throw',
description: 'stuns and makes the target take increased red damage' }, Empower: {
{ name: 'Triage', description: 'increase the red damage dealt by a cryp',
description: 'grants a blue damage based healing over time buff' } },
]
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',
},
},
}, },
}; };

View File

@ -16,7 +16,7 @@ class HomeNavigation extends Phaser.Scene {
} }
create() { create() {
const ranks = this.add /* const ranks = this.add
.rectangle(X, Y, BTN_WIDTH, BTN_HEIGHT, 0x222222) .rectangle(X, Y, BTN_WIDTH, BTN_HEIGHT, 0x222222)
.setInteractive() .setInteractive()
.setOrigin(0); .setOrigin(0);
@ -50,7 +50,7 @@ class HomeNavigation extends Phaser.Scene {
this.add this.add
.text(instances.getCenter().x, instances.getCenter().y, 'Instances', TEXT.HEADER) .text(instances.getCenter().x, instances.getCenter().y, 'Instances', TEXT.HEADER)
.setOrigin(0.5, 0.5); .setOrigin(0.5, 0.5);
instances.on('pointerdown', () => this.registry.set('homeInstances', true)); instances.on('pointerdown', () => this.registry.set('homeInstances', true));*/
} }
cleanUp() { cleanUp() {

View File

@ -1,5 +1,5 @@
const Phaser = require('phaser'); 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 X = MENU_MAIN.x();
const Y = MENU_MAIN.y(); const Y = MENU_MAIN.y();
@ -18,12 +18,39 @@ class ItemInfo extends Phaser.Scene {
create(props) { create(props) {
const { item, cryp } = props; const { item, cryp } = props;
if (!item) return false; 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; if (!cryp) return true;
const ws = this.registry.get('ws'); const ws = this.registry.get('ws');
const { vbox } = this.registry.get('player'); const { vbox } = this.registry.get('player');
const unEquip = this.add.rectangle(X, UNEQUIP_Y, UNEQUIP_WIDTH, UNEQUIP_HEIGHT, 0x222222) const unEquip = this.add.rectangle(X, UNEQUIP_Y, UNEQUIP_WIDTH, UNEQUIP_HEIGHT, 0x222222)
.setOrigin(0, 0) .setOrigin(0, 0)
.setInteractive() .setInteractive()

View File

@ -54,17 +54,19 @@ class StatSheet extends Phaser.Scene {
create(cryp) { create(cryp) {
this.registry.events.on('changedata', this.updateData, this); 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'); const player = this.registry.get('player');
if (!player) return false; if (!player) return false;
const { vbox } = player; // const { vbox } = player;
this.cryp = cryp; this.cryp = cryp;
/*
const del = this.add.existing(new DeleteHitBox(this, X + WIDTH * 0.7, Y + HEIGHT * 0.6)); 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) this.add.text(del.getCenter().x, del.getCenter().y, 'unequip', TEXT.HEADER)
.setOrigin(0.5, 0.5); .setOrigin(0.5, 0.5);
*/
this.add.text(X, Y, cryp.name, TEXT.HEADER); this.add.text(X, Y, cryp.name, TEXT.HEADER);
@ -85,6 +87,7 @@ class StatSheet extends Phaser.Scene {
]; ];
CRYP_STATS.forEach(crypStat); CRYP_STATS.forEach(crypStat);
/*
const knownSkill = (skill, i) => { const knownSkill = (skill, i) => {
const SKILL_X = X + WIDTH * 0.4 + WIDTH * 0.125 * i; const SKILL_X = X + WIDTH * 0.4 + WIDTH * 0.125 * i;
const SKILL_Y = Y + HEIGHT * 0.15; const SKILL_Y = Y + HEIGHT * 0.15;
@ -127,19 +130,10 @@ class StatSheet extends Phaser.Scene {
} }
return true; return true;
}); });
*/
return this; 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() { cleanUp() {
this.registry.events.off('changedata', this.updateData, this); this.registry.events.off('changedata', this.updateData, this);
this.scene.remove(); this.scene.remove();