skill descriptions

This commit is contained in:
ntr 2018-12-17 17:45:53 +11:00
parent 783fa736d4
commit 47b8182cfb
4 changed files with 110 additions and 80 deletions

View File

@ -27,6 +27,7 @@ const statsX = () => crypListWidth() + gameListWidth();
const statsKnownX = () => Math.floor(statsX() + statsWidth() / 4); const statsKnownX = () => Math.floor(statsX() + statsWidth() / 4);
const statsLearnableX = () => Math.floor(statsX() + statsWidth() / 2); const statsLearnableX = () => Math.floor(statsX() + statsWidth() / 2);
const statsTextMargin = () => 24; const statsTextMargin = () => 24;
const statsLearnableMargin = () => 12;
const logWidth = () => combatWidth(); const logWidth = () => combatWidth();
const logHeight = () => combatHeight() * 0.3; const logHeight = () => combatHeight() * 0.3;
@ -37,6 +38,7 @@ const logX = () => combatWidth() * 0.6;
module.exports = { module.exports = {
TEXT: { TEXT: {
NORMAL: { fontFamily: 'monospace', fontSize: 16, color: '#ffffff' }, NORMAL: { fontFamily: 'monospace', fontSize: 16, color: '#ffffff' },
LEARNABLE: { fontFamily: 'monospace', fontSize: 12, color: '#ffffff' },
HEADER: { fontFamily: 'monospace', fontSize: 24, color: '#ffffff', fontStyle: 'bold' }, HEADER: { fontFamily: 'monospace', fontSize: 24, color: '#ffffff', fontStyle: 'bold' },
}, },
@ -63,6 +65,7 @@ module.exports = {
knownX: statsKnownX, knownX: statsKnownX,
learnableX: statsLearnableX, learnableX: statsLearnableX,
textMargin: statsTextMargin, textMargin: statsTextMargin,
learnableMargin: statsLearnableMargin,
}, },
COMBAT: { COMBAT: {
@ -117,77 +120,94 @@ module.exports = {
SKILLS: { SKILLS: {
LEARNABLE: [ LEARNABLE: [
'Attack', {
name: 'Attack',
// ----------------- description: 'a fast physical attack with phys dmg',
// Nature },
// ----------------- {
'Block', // reduce dmg name: 'Block',
'Parry', // avoid all dmg description: 'decreases incoming physical damage for 1T',
'Snare', },
{
// 'Paralyse', name: 'Parry',
description: 'prevents all physical damage for 1T',
// 'Strangle', // physical dot and disable },
{
'Stun', name: 'Evade',
'Throw', description: 'gives a chance to evade physical damage for 1T',
'Evade', // actively evade },
'Evasion', // adds evasion to cryp {
name: 'Snare',
description: 'prevents physical skills from being used for 2T',
// ----------------- },
// Technology {
// ----------------- name: 'Stun',
// 'Replicate', description: 'physical skill that prevents target cryp from using any skills',
// 'Swarm', },
// 'Orbit', {
// 'Repair', name: 'Evasion',
// 'Scan', // track? description: 'grants Evade effect to a cryp',
},
// ----------------- {
// Nonviolence name: 'Heal',
// ----------------- description: 'heal a cryp with spell dmg',
'Heal', },
'Triage', // hot {
// 'TriageTick', name: 'Triage',
// 'Charm', description: 'grants a spell dmg based healing over time buff',
// 'Calm', },
// 'Rez', {
name: 'Throw',
// ------------------- description: 'stuns and makes the target take increased physical damage',
// Destruction },
// ------------------- {
'Blast', name: 'Blast',
'Amplify', description: 'blast the target with magic damage',
'Decay', // dot },
// 'DecayTick', // dot {
'Drain', name: 'Amplify',
// 'DrainTick', description: 'increase the magic damage dealt by a cryp',
'Curse', },
// 'Plague', // aoe dot {
// 'Ruin', // aoe name: 'Decay',
description: 'afflict a cryp with a spell damage based damage over time debuff',
// ----------------- },
// Purity {
// ----------------- name: 'Drain',
'Empower', description: 'drain hp from target cryp with a spell damage based debuff',
// 'Slay', },
'Shield', {
'Silence', name: 'Curse',
// 'Inquiry', description: 'target cryp takes increased magic damage',
'Purify', },
'Purge', {
// '// Precision', name: 'Empower',
description: 'increase the physical damage dealt by a cryp',
// ----------------- },
// Chaos {
// ----------------- name: 'Shield',
'Banish', // disables everything, incoming and outgoing description: 'grants immunity to magical skills to target cryp',
'Hex', // stun but as a spell },
// 'Fear', {
// 'Taunt', name: 'Silence',
// 'Pause', // speed slow 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',
},
], ],
}, },
}; };

View File

@ -33,10 +33,11 @@ class CrypPage extends Phaser.GameObjects.Group {
}; };
const learnable = (skill, i) => { const learnable = (skill, i) => {
console.log(skill);
const SKILL_X = STATS.learnableX(); const SKILL_X = STATS.learnableX();
const SKILL_Y = (i * TEXT_MARGIN) + STATS.y() + TEXT_MARGIN; 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(); .setInteractive();
text.on('pointerdown', () => { text.on('pointerdown', () => {

View File

@ -76,12 +76,12 @@ class Skills extends Phaser.Scene {
this.learnSkills = this.add.group(); this.learnSkills = this.add.group();
const learnable = (skill, i) => { const learnable = (skill, i) => {
const SKILL_X = X_ORIG_LEARN; 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() .setInteractive()
.on('pointerdown', () => { .on('pointerdown', () => {
this.registry.get('ws').sendCrypLearn(cryp.id, skill); this.registry.get('ws').sendCrypLearn(cryp.id, skill.name);
})); }));
}; };

View File

@ -196,9 +196,12 @@ impl Effect {
pub fn modifications(&self) -> Vec<Stat> { pub fn modifications(&self) -> Vec<Stat> {
match self { match self {
Effect::Amplify => vec![Stat::SpellDmg],
Effect::Empower => vec![Stat::PhysDmg], Effect::Empower => vec![Stat::PhysDmg],
Effect::Vulnerable => vec![Stat::PhysDmg],
Effect::Block => vec![Stat::PhysDmg], Effect::Block => vec![Stat::PhysDmg],
Effect::Amplify => vec![Stat::SpellDmg],
Effect::Curse => vec![Stat::SpellDmg],
_ => vec![], _ => vec![],
} }
} }
@ -208,10 +211,16 @@ impl Effect {
// and OR with base stat // and OR with base stat
pub fn apply(&self, value: u64) -> u64 { pub fn apply(&self, value: u64) -> u64 {
match self { match self {
Effect::Block => value >> 1,
Effect::Amplify => value << 1,
Effect::Empower => value << 1, Effect::Empower => value << 1,
_ => panic!("{:?} does not have a mod effect", self), 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;
},
} }
} }