Started work on character log for rolls to be stored
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import spendResources from '/imports/api/creature/actions/spendResources.js'
|
||||
import {insertCreatureLog} from '/imports/api/creature/log/CreatureLogs.js';
|
||||
|
||||
export default function applyAction({prop}){
|
||||
export default function applyAction({prop, creature}){
|
||||
spendResources(prop);
|
||||
insertCreatureLog({
|
||||
log: prop.name,
|
||||
creature,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import math from '/imports/math.js';
|
||||
//if (Meteor.isServer){
|
||||
// var sendWebhook = require('/imports/server/discord/webhook.js').default;
|
||||
//}
|
||||
import {insertCreatureLog} from '/imports/api/creature/log/CreatureLogs.js';
|
||||
|
||||
export default function applyAttack({
|
||||
prop,
|
||||
@@ -11,11 +9,8 @@ export default function applyAttack({
|
||||
//actionContext
|
||||
}){
|
||||
let result = math.roll(1, 20) + prop.rollBonusResult;
|
||||
if (Meteor.isClient){
|
||||
console.log(`${creature.name} makes a ${prop.name} attack! Rolls ${result} to hit`);
|
||||
}
|
||||
//if (Meteor.isServer) sendWebhook({
|
||||
// webhook: creature.webhook,
|
||||
// message: `${creature.name} makes a ${prop.name} attack! Rolls ${result} to hit`,
|
||||
//});
|
||||
insertCreatureLog({
|
||||
log: `${prop.name} attack. ${result} to hit`,
|
||||
creature,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ function applyProperty(options){
|
||||
applyAction(options);
|
||||
return true;
|
||||
case 'attack':
|
||||
applyAttack(options);
|
||||
applyAction(options);
|
||||
applyAttack(options);
|
||||
return true;
|
||||
case 'damage':
|
||||
applyDamage(options);
|
||||
|
||||
Reference in New Issue
Block a user