added related messages, added skillcheck for spells (cast)
This commit is contained in:
21
functions/CreateResultTable.js
Normal file
21
functions/CreateResultTable.js
Normal file
@ -0,0 +1,21 @@
|
||||
const CreateResultTable = ({ Attributes: Attributes, Throws: Throws, PointsUsed: PointsUsed, Bonus: Bonus = 0 }) => {
|
||||
return `
|
||||
\`\`\`
|
||||
${''.padEnd(15)} ${Attributes.map(attr => `${attr.Name}`.padStart(6)).join('\t|\t')}\t|
|
||||
${'Dein Wert'.padEnd(15)} ${Attributes.map(attr => `${attr.Level}${Bonus ? `(${f(Bonus)})` : ``}`.padStart(6)).join(
|
||||
'\t|\t'
|
||||
)}\t|
|
||||
${'Dein Wurf'.padEnd(15)} ${Throws.map(Throw => `${Throw}`.padStart(6)).join('\t|\t')}\t|
|
||||
${'Abzüge'.padEnd(15)} ${PointsUsed.map(Points => `${Points}`.replace(0, '--').padStart(6)).join('\t|\t')}\t|
|
||||
${'Gesamt'.padEnd(15)} ${PointsUsed.reduce((acc, cur) => acc + cur)
|
||||
.toString()
|
||||
.padStart(6)}
|
||||
\`\`\`
|
||||
`;
|
||||
};
|
||||
|
||||
const f = n => {
|
||||
return (n > 0 ? '+' : '') + n;
|
||||
};
|
||||
|
||||
module.exports = { CreateResultTable };
|
Reference in New Issue
Block a user