Files
DiceCloud/app/imports/api/creature/actions/applyAttack.js
2021-02-11 15:48:23 +02:00

15 lines
358 B
JavaScript

import roll from '/imports/parser/roll.js';
export default function applyAttack({
prop,
log,
}){
let result = roll(1, 20)[0] + prop.rollBonusResult;
log.content.push({
// If this is not the first item in the log content, give it a name
name: log.content.length ? prop.name + ' attack' : undefined,
result,
details: 'to hit',
});
}