Syn for 0.8.0
This commit is contained in:
parent
5ceeefb522
commit
142c22d85f
@ -415,18 +415,18 @@ export class SoSActor extends Actor {
|
|||||||
currentWounds.value = sumWound;
|
currentWounds.value = sumWound;
|
||||||
if ( sumWound >= this.data.data.scores.wound.value) {
|
if ( sumWound >= this.data.data.scores.wound.value) {
|
||||||
let bleeding = this.data.items.find( item => item.type == 'consequence' && item.name == 'Bleeding');
|
let bleeding = this.data.items.find( item => item.type == 'consequence' && item.name == 'Bleeding');
|
||||||
let newSeverity = SoSUtility.increaseConsequenceSeverity( bleeding.severity );
|
let newSeverity = SoSUtility.increaseConsequenceSeverity( bleeding.data.severity );
|
||||||
await this.updateOwnedItem( { _id: bleeding.id, 'data.severity': newSeverity});
|
await this.updateEmbeddedDocuments( "Item", [ { _id: bleeding.id, 'data.severity': newSeverity} ] );
|
||||||
flipData.isBleeding = newSeverity;
|
flipData.isBleeding = newSeverity;
|
||||||
}
|
}
|
||||||
// Stun consequence
|
// Stun consequence
|
||||||
if ( flipData.nbStun > 0) {
|
if ( flipData.nbStun > 0) {
|
||||||
let stun = this.data.items.find( item => item.type == 'consequence' && item.name == 'Sun');
|
let stun = this.data.items.find( item => item.type == 'consequence' && item.name == 'Stun');
|
||||||
let newSeverity = stun.severity;
|
let newSeverity = stun.data.severity;
|
||||||
for(i=0; i<flipData.nbStun; i++) {
|
for(let i=0; i<flipData.nbStun; i++) {
|
||||||
newSeverity = SoSUtility.increaseConsequenceSeverity( newSeverity );
|
newSeverity = SoSUtility.increaseConsequenceSeverity( newSeverity );
|
||||||
}
|
}
|
||||||
await this.updateOwnedItem( { _id: stun.id, 'data.severity': newSeverity});
|
await this.updateEmbeddedDocuments( "Item", [ { _id: stun.id, 'data.severity': newSeverity} ] );
|
||||||
flipData.isStun = newSeverity;
|
flipData.isStun = newSeverity;
|
||||||
}
|
}
|
||||||
await this.update( { 'data.scores.currentwounds': currentWounds, 'data.wounds': wounds } );
|
await this.update( { 'data.scores.currentwounds': currentWounds, 'data.wounds': wounds } );
|
||||||
|
Loading…
Reference in New Issue
Block a user