Add items
This commit is contained in:
@ -227,6 +227,7 @@ export class SoSActor extends Actor {
|
||||
modifierList: SoSUtility.fillRange(-10, +10),
|
||||
tnList: SoSUtility.fillRange(6, 20),
|
||||
consequencesList: duplicate( this.getApplicableConsequences() ),
|
||||
wounds: duplicate( this.data.data.wounds),
|
||||
malusConsequence: 0,
|
||||
bonusConsequence: 0
|
||||
}
|
||||
@ -241,6 +242,7 @@ export class SoSActor extends Actor {
|
||||
statList: duplicate(this.data.data.stats),
|
||||
selectedStat: 'strength',
|
||||
consequencesList: duplicate( this.getApplicableConsequences() ),
|
||||
wounds: duplicate( this.data.data.wounds),
|
||||
skill: duplicate(skill),
|
||||
actor: this,
|
||||
modifierList: SoSUtility.fillRange(-10, +10),
|
||||
@ -275,6 +277,7 @@ export class SoSActor extends Actor {
|
||||
target: target,
|
||||
selectedStat: selectedStatName,
|
||||
consequencesList: duplicate( this.getApplicableConsequences() ),
|
||||
wounds: duplicate( this.data.data.wounds),
|
||||
skill: duplicate(skill),
|
||||
actor: this,
|
||||
modifierList: SoSUtility.fillRange(-10, +10),
|
||||
|
@ -244,9 +244,9 @@ export class SoSCardDeck {
|
||||
|
||||
// Compute final result and compare
|
||||
if ( flipData.mode == 'stat' || flipData.mode == 'weapon' ) {
|
||||
flipData.baseScore = flipData.stat.value + flipData.malusConsequence;
|
||||
flipData.baseScore = flipData.stat.value + flipData.malusConsequence + flipData.bonusConsequence + flipData.woundMalus;
|
||||
} else if (flipData.mode == 'skill') {
|
||||
flipData.baseScore = Math.floor(flipData.stat.value/2) + flipData.skill.data.value + flipData.malusConsequence
|
||||
flipData.baseScore = Math.floor(flipData.stat.value/2) + flipData.skill.data.value + flipData.malusConsequence + flipData.bonusConsequence + flipData.woundMalus;
|
||||
}
|
||||
flipData.finalScore = flipData.baseScore + flipData.cardTotal + Number(flipData.modifier);
|
||||
flipData.magnitude = flipData.finalScore - flipData.tn;
|
||||
|
@ -33,10 +33,17 @@ export class SoSFlipDialog extends Dialog {
|
||||
scoreBase = Math.floor(this.flipData.statList[ statKey ].value / 2) + this.flipData.skill.data.value;
|
||||
} else { //Stat mode
|
||||
let statKey = $('#statSelect').val();
|
||||
scoreBase = this.flipData.stat.value;
|
||||
scoreBase = this.flipData.stat.value;
|
||||
}
|
||||
this.flipData.woundMalus = 0;
|
||||
this.flipData.woundMalus += ($('#wound-light-checkbox').is(":checked")) ? (-1) : 0;
|
||||
this.flipData.woundMalus += ($('#wound-moderate-checkbox').is(":checked")) ? (-2) : 0;
|
||||
this.flipData.woundMalus += ($('#wound-severe-checkbox').is(":checked")) ? (-3) : 0;
|
||||
this.flipData.woundMalus += ($('#wound-critical-checkbox').is(":checked")) ? (-4) : 0;
|
||||
scoreBase += this.flipData.malusConsequence;
|
||||
scoreBase += this.flipData.bonusConsequence;
|
||||
scoreBase += this.flipData.woundMalus;
|
||||
$('#wound-malus').text(this.flipData.woundMalus);
|
||||
$('#score-base').text( scoreBase);
|
||||
}
|
||||
|
||||
@ -122,6 +129,18 @@ export class SoSFlipDialog extends Dialog {
|
||||
html.find('#consequenceSelectBonus').change((event) => {
|
||||
this.updateConsequenceBonus( event );
|
||||
} );
|
||||
html.find('#wound-light-checkbox').change((event) => {
|
||||
this.updateScoreBase( event );
|
||||
} );
|
||||
html.find('#wound-moderate-checkbox').change((event) => {
|
||||
this.updateScoreBase( event );
|
||||
} );
|
||||
html.find('#wound-severe-checkbox').change((event) => {
|
||||
this.updateScoreBase( event );
|
||||
} );
|
||||
html.find('#wound-critical-checkbox').change((event) => {
|
||||
this.updateScoreBase( event );
|
||||
} );
|
||||
|
||||
html.find('.class-view-deck').click((event) => {
|
||||
let flipData = this.flipData;
|
||||
|
Reference in New Issue
Block a user