diff --git a/client/src/scenes/constants.js b/client/src/scenes/constants.js index a6d1850d..ee9ed187 100644 --- a/client/src/scenes/constants.js +++ b/client/src/scenes/constants.js @@ -27,6 +27,7 @@ const statsX = () => crypListWidth() + gameListWidth(); const statsKnownX = () => Math.floor(statsX() + statsWidth() / 4); const statsLearnableX = () => Math.floor(statsX() + statsWidth() / 2); const statsTextMargin = () => 24; +const statsLearnableMargin = () => 12; const logWidth = () => combatWidth(); const logHeight = () => combatHeight() * 0.3; @@ -37,6 +38,7 @@ const logX = () => combatWidth() * 0.6; module.exports = { TEXT: { NORMAL: { fontFamily: 'monospace', fontSize: 16, color: '#ffffff' }, + LEARNABLE: { fontFamily: 'monospace', fontSize: 12, color: '#ffffff' }, HEADER: { fontFamily: 'monospace', fontSize: 24, color: '#ffffff', fontStyle: 'bold' }, }, @@ -63,6 +65,7 @@ module.exports = { knownX: statsKnownX, learnableX: statsLearnableX, textMargin: statsTextMargin, + learnableMargin: statsLearnableMargin, }, COMBAT: { @@ -117,77 +120,94 @@ module.exports = { SKILLS: { LEARNABLE: [ - 'Attack', - - // ----------------- - // Nature - // ----------------- - 'Block', // reduce dmg - 'Parry', // avoid all dmg - 'Snare', - - // 'Paralyse', - - // 'Strangle', // physical dot and disable - - 'Stun', - 'Throw', - 'Evade', // actively evade - 'Evasion', // adds evasion to cryp - - - // ----------------- - // Technology - // ----------------- - // 'Replicate', - // 'Swarm', - // 'Orbit', - // 'Repair', - // 'Scan', // track? - - // ----------------- - // Nonviolence - // ----------------- - 'Heal', - 'Triage', // hot - // 'TriageTick', - // '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', // disables everything, incoming and outgoing - 'Hex', // stun but as a spell - // 'Fear', - // 'Taunt', - // 'Pause', // speed slow + { + name: 'Attack', + description: 'a fast physical attack with phys dmg', + }, + { + name: 'Block', + description: 'decreases incoming physical damage for 1T', + }, + { + name: 'Parry', + description: 'prevents all physical damage for 1T', + }, + { + name: 'Evade', + description: 'gives a chance to evade physical damage for 1T', + }, + { + name: 'Snare', + description: 'prevents physical skills from being used for 2T', + }, + { + name: 'Stun', + description: 'physical skill that prevents target cryp from using any skills', + }, + { + name: 'Evasion', + description: 'grants Evade effect to a cryp', + }, + { + name: 'Heal', + description: 'heal a cryp with spell dmg', + }, + { + name: 'Triage', + description: 'grants a spell dmg based healing over time buff', + }, + { + name: 'Throw', + description: 'stuns and makes the target take increased physical damage', + }, + { + name: 'Blast', + description: 'blast the target with magic damage', + }, + { + name: 'Amplify', + description: 'increase the magic damage dealt by a cryp', + }, + { + name: 'Decay', + description: 'afflict a cryp with a spell damage based damage over time debuff', + }, + { + name: 'Drain', + description: 'drain hp from target cryp with a spell damage based debuff', + }, + { + name: 'Curse', + description: 'target cryp takes increased magic damage', + }, + { + name: 'Empower', + description: 'increase the physical damage dealt by a cryp', + }, + { + name: 'Shield', + description: 'grants immunity to magical skills to target cryp', + }, + { + name: 'Silence', + description: 'prevent target cryp from casting magical skills', + }, + { + name: 'Purify', + description: 'remove physical debuffs from target cryp', + }, + { + name: 'Purge', + description: 'remove magical debuffs from target cryp', + }, + { + name: 'Banish', + description: 'target cryp is prevented from casting any skills and taking any damage', + }, + { + name: 'Hex', + description: 'magical based skill that prevents target cryp from using any skills', + }, ], }, }; diff --git a/client/src/scenes/cryp.page.js b/client/src/scenes/cryp.page.js index ee7755e2..a1bffb8c 100644 --- a/client/src/scenes/cryp.page.js +++ b/client/src/scenes/cryp.page.js @@ -33,10 +33,11 @@ class CrypPage extends Phaser.GameObjects.Group { }; const learnable = (skill, i) => { + console.log(skill); const SKILL_X = STATS.learnableX(); const SKILL_Y = (i * TEXT_MARGIN) + STATS.y() + TEXT_MARGIN; - const text = scene.add.text(SKILL_X, SKILL_Y, skill, TEXT.NORMAL) + const text = scene.add.text(SKILL_X, SKILL_Y, `${skill.name}\n${skill.description}`, TEXT.NORMAL) .setInteractive(); text.on('pointerdown', () => { diff --git a/client/src/scenes/statsheet.skills.js b/client/src/scenes/statsheet.skills.js index d31098fc..752dbaab 100644 --- a/client/src/scenes/statsheet.skills.js +++ b/client/src/scenes/statsheet.skills.js @@ -76,12 +76,12 @@ class Skills extends Phaser.Scene { this.learnSkills = this.add.group(); const learnable = (skill, i) => { const SKILL_X = X_ORIG_LEARN; - const SKILL_Y = Y_ORIG + (i * TEXT_MARGIN) + TEXT_MARGIN; + const SKILL_Y = Y_ORIG + (i * STATS.learnableMargin() * 3) + TEXT_MARGIN; - this.learnSkills.add(this.add.text(SKILL_X, SKILL_Y, skill, TEXT.NORMAL) + this.learnSkills.add(this.add.text(SKILL_X, SKILL_Y, [skill.name, skill.description], TEXT.LEARNABLE) .setInteractive() .on('pointerdown', () => { - this.registry.get('ws').sendCrypLearn(cryp.id, skill); + this.registry.get('ws').sendCrypLearn(cryp.id, skill.name); })); }; diff --git a/server/src/skill.rs b/server/src/skill.rs index bfe2bfb2..231dba61 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -196,9 +196,12 @@ impl Effect { pub fn modifications(&self) -> Vec { match self { - Effect::Amplify => vec![Stat::SpellDmg], Effect::Empower => vec![Stat::PhysDmg], + Effect::Vulnerable => vec![Stat::PhysDmg], Effect::Block => vec![Stat::PhysDmg], + + Effect::Amplify => vec![Stat::SpellDmg], + Effect::Curse => vec![Stat::SpellDmg], _ => vec![], } } @@ -208,10 +211,16 @@ impl Effect { // and OR with base stat pub fn apply(&self, value: u64) -> u64 { match self { - Effect::Block => value >> 1, - Effect::Amplify => value << 1, - Effect::Empower => value << 1, - _ => panic!("{:?} does not have a mod effect", self), + Effect::Empower => value << 1, + Effect::Vulnerable => value << 1, + Effect::Block => value >> 1, + + Effect::Amplify => value << 1, + Effect::Curse => value << 1, + _ => { + println!("{:?} does not have a mod effect", self); + return value; + }, } }