mods are now displayed correctly
parent
53806e620f
commit
f56f0be0b2
|
|
@ -102,21 +102,25 @@ export class TalentDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
const context = {
|
||||
talent: this._talent.name,
|
||||
taw,
|
||||
mod: modValue,
|
||||
ergebnis: [
|
||||
{
|
||||
eigenschaft: this._talent.system.probe[0],
|
||||
eigenschaftWert: this._actor.system.attribute[this._talent.system.probe[0].toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[0].result
|
||||
eigenschaftWert: taw + modValue < 0 ? this._actor.system.attribute[this._talent.system.probe[0].toLowerCase()].aktuell + (taw + modValue) : this._actor.system.attribute[this._talent.system.probe[0].toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[0].result,
|
||||
reduced: taw + modValue < 0
|
||||
},
|
||||
{
|
||||
eigenschaft: this._talent.system.probe[1],
|
||||
eigenschaftWert: this._actor.system.attribute[this._talent.system.probe[1].toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[1].result
|
||||
eigenschaftWert: taw + modValue < 0 ? this._actor.system.attribute[this._talent.system.probe[1].toLowerCase()].aktuell + (taw + modValue) : this._actor.system.attribute[this._talent.system.probe[1].toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[1].result,
|
||||
reduced: taw + modValue < 0
|
||||
},
|
||||
{
|
||||
eigenschaft: this._talent.system.probe[2],
|
||||
eigenschaftWert: this._actor.system.attribute[this._talent.system.probe[2].toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[2].result
|
||||
eigenschaftWert: taw + modValue < 0 ? this._actor.system.attribute[this._talent.system.probe[2].toLowerCase()].aktuell + (taw + modValue) : this._actor.system.attribute[this._talent.system.probe[2].toLowerCase()].aktuell,
|
||||
wuerfelErgebnis: result.evaluated.terms[0].results[2].result,
|
||||
reduced: taw + modValue < 0
|
||||
}
|
||||
],
|
||||
patzer: result.patzer,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const evaluateRoll = async (rolledDice, {
|
|||
countToMeisterlich = 3,
|
||||
countToPatzer = 3,
|
||||
}, rollObject = Roll) => {
|
||||
let tap = value - mod;
|
||||
let tap = value + mod;
|
||||
let meisterlichCounter = 0;
|
||||
let patzerCounter = 0;
|
||||
let failCounter = 0;
|
||||
|
|
|
|||
|
|
@ -96,14 +96,14 @@ describe('Attribute Checks', () => {
|
|||
describe('Skill Checks', () => {
|
||||
|
||||
it('should yield positive TAP when the die roll matches values of used attributes', async () => {
|
||||
|
||||
let taw = 5
|
||||
let actual = await evaluateRoll("3d20",{
|
||||
value: 1,
|
||||
value: taw,
|
||||
werte: [12, 12, 12],
|
||||
owner
|
||||
}, RollWithMockResults(12, 12, 12))
|
||||
|
||||
expect(actual.tap).toBeGreaterThan(0)
|
||||
expect(actual.tap).toBe(taw)
|
||||
})
|
||||
|
||||
it('should succeed with a TaP* of 1 when the die roll are exactly the values of used attributes', async () => {
|
||||
|
|
@ -114,7 +114,7 @@ describe('Skill Checks', () => {
|
|||
owner
|
||||
}, RollWithMockResults(12, 12, 12))
|
||||
|
||||
expect(actual.tap).toBe(0)
|
||||
expect(actual.tap).toBe(1)
|
||||
expect(actual.patzer).toBe(false)
|
||||
})
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ describe('Skill Checks', () => {
|
|||
mod: -3,
|
||||
werte: [12, 12, 12],
|
||||
owner
|
||||
}, RollWithMockResults(13, 13, 13))
|
||||
}, RollWithMockResults(10, 10, 10))
|
||||
|
||||
expect(actual.tap).toBe(-3)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@
|
|||
line-height: 16px;
|
||||
height: 16px;
|
||||
vertical-align: middle;
|
||||
|
||||
&.modified {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
span.value {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
|
||||
<div>
|
||||
<div>{{talent}} (TaW: {{taw}})</div>
|
||||
<div>Modifiziert: {{mod}}</div>
|
||||
<div>Gewürfelt:</div>
|
||||
<section class="die">
|
||||
{{#each ergebnis}}
|
||||
<div>
|
||||
<span class="provided">{{eigenschaft}} ({{eigenschaftWert}})</span>
|
||||
<span class="provided {{#if reduced}}modified{{/if}}">{{eigenschaft}} ({{eigenschaftWert}})</span>
|
||||
<span class="value">{{wuerfelErgebnis}}</span>
|
||||
</div>
|
||||
{{/each}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue