diff --git a/app/imports/api/creature/log/LogContentSchema.js b/app/imports/api/creature/log/LogContentSchema.js index 68d91ceb..05d9ce87 100644 --- a/app/imports/api/creature/log/LogContentSchema.js +++ b/app/imports/api/creature/log/LogContentSchema.js @@ -17,6 +17,11 @@ let LogContentSchema = new SimpleSchema({ optional: true, max: STORAGE_LIMITS.summary, }, + // Inline with other content fields + inline: { + type: Boolean, + optional: true, + }, context: { type: Object, optional: true, diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js index 6f9a413e..a92255c1 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js @@ -67,7 +67,8 @@ function applyAttackWithoutTarget({attack, scope, log}){ } log.content.push({ name, - value: `${resultPrefix} **${result}**`, + value: `${resultPrefix}\n**${result}**`, + inline: true, }); } @@ -102,7 +103,8 @@ function applyAttackToTarget({attack, target, scope, log}){ log.content.push({ name, - value: `${resultPrefix} **${result}**`, + value: `${resultPrefix}\n**${result}**`, + inline: true, }); if ((result > armor) || (criticalHit)){ scope['$attackHit'] = true; @@ -116,7 +118,8 @@ function applyAttackToTarget({attack, target, scope, log}){ }); log.content.push({ name: criticalHit ? 'Critical Hit!' : criticalMiss ? 'Critical Miss!' : 'To Hit', - value: `${resultPrefix} **${result}**`, + value: `${resultPrefix}\n**${result}**`, + inline: true, }); } } @@ -128,23 +131,23 @@ function rollAttack(attack, scope){ const [a, b] = rollDice(2, 20); if (a >= b) { value = a; - resultPrefix = `1d20 [ ${a}, ~~${b}~~ ] ${rollModifierText} = `; + resultPrefix = `1d20 [ ${a}, ~~${b}~~ ] ${rollModifierText}`; } else { value = b; - resultPrefix = `1d20 [ ~~${a}~~, ${b} ] ${rollModifierText} = `; + resultPrefix = `1d20 [ ~~${a}~~, ${b} ] ${rollModifierText}`; } } else if (attack.advantage === -1 || scope['$attackDisadvantage']){ const [a, b] = rollDice(2, 20); if (a <= b) { value = a; - resultPrefix = `1d20 [ ${a}, ~~${b}~~ ] ${rollModifierText} = `; + resultPrefix = `1d20 [ ${a}, ~~${b}~~ ] ${rollModifierText}`; } else { value = b; - resultPrefix = `1d20 [ ~~${a}~~, ${b} ] ${rollModifierText} = `; + resultPrefix = `1d20 [ ~~${a}~~, ${b} ] ${rollModifierText}`; } } else { value = rollDice(1, 20)[0]; - resultPrefix = `1d20 [${value}] ${rollModifierText} = ` + resultPrefix = `1d20 [${value}] ${rollModifierText}` } scope['$attackRoll'] = {value}; const result = value + attack.value; @@ -251,6 +254,7 @@ function spendResources({prop, log, scope}){ log.content.push({ name: 'Uses left', value: prop.usesLeft - 1, + inline: true, }); } @@ -280,9 +284,11 @@ function spendResources({prop, log, scope}){ if (gainLog.length) log.content.push({ name: 'Gained', value: gainLog.join('\n'), + inline: true, }); if (spendLog.length) log.content.push({ name: 'Spent', value: spendLog.join('\n'), + inline: true, }); } diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyAdjustment.js b/app/imports/api/engine/actions/applyPropertyByType/applyAdjustment.js index bea1c945..1a266fab 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyAdjustment.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyAdjustment.js @@ -14,7 +14,7 @@ export default function applyAdjustment(node, { // Evaluate the amount recalculateCalculation(prop.amount, scope, log); - + const value = +prop.amount.value; if (!isFinite(value)) { return applyChildren(node, {creature, targets, scope, log}); @@ -39,6 +39,7 @@ export default function applyAdjustment(node, { name: 'Attribute damage', value: `${prop.stat}${prop.operation === 'set' ? ' set to' : ''}` + ` ${value}`, + inline: true, }); }); } else { @@ -46,6 +47,7 @@ export default function applyAdjustment(node, { name: 'Attribute damage', value: `${prop.stat}${prop.operation === 'set' ? ' set to' : ''}` + ` ${value}`, + inline: true, }); } diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js b/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js index af4210f6..697d1a6c 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js @@ -77,7 +77,7 @@ function crystalizeVariables({propList, scope, log}){ // Can't strip symbols log.content.push({ name: 'Error', - value: 'Variable `$target` should not be used without a property: $target.property' + value: 'Variable `$target` should not be used without a property: $target.property', }); } return node; diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js b/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js index 6c10a5ba..5e2153fc 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js @@ -110,6 +110,7 @@ export default function applyDamage(node, { log.content.push({ name: logName, value: logValue.join('\n'), + inline: true, }); return applyChildren(); } diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js b/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js index 67e2e42f..d37aabfe 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js @@ -13,6 +13,7 @@ export default function applyRoll(node, {creature, targets, scope, log}){ log.content.push({ name: prop.name, value: prop.variableName + ' = ' + prop.roll.calculation + ' = ' + prop.roll.value, + inline: true, }); } return node.children.forEach(child => applyProperty(child, { diff --git a/app/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js b/app/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js index b55525ed..b94ccc13 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js @@ -23,6 +23,7 @@ export default function applySavingThrow(node, {creature, targets, scope, log}){ log.content.push({ name: prop.name, value: ' DC ' + dc, + inline: true, }); saveTargets.forEach(target => { @@ -84,7 +85,8 @@ export default function applySavingThrow(node, {creature, targets, scope, log}){ } log.content.push({ name: 'Save', - value: resultPrefix + result + (saveSuccess ? 'Passed' : 'Failed') + value: resultPrefix + result + (saveSuccess ? 'Passed' : 'Failed'), + inline: true, }); return applyChildren(); });