Auto formatting

This commit is contained in:
Vincent Vandemeulebrouck 2021-01-10 02:28:45 +01:00
parent 3f62582af5
commit 3ee1b593c8

View File

@ -695,14 +695,14 @@ export class RdDActor extends Actor {
return true;
}
/* -------------------------------------------- */
buildSubConteneurObjetList( conteneurId, deleteList ) {
let conteneur = this.items.find( conteneur => conteneurId == conteneur._id); // recup conteneur
if ( conteneur && conteneur.type =='conteneur' ) { // Si présent
for ( let subId of conteneur.data.data.contenu ) {
let subObj = this.items.find( subobjet => subId == subobjet._id); // recup conteneur
if ( subObj && subObj.type == 'conteneur') {
this.buildSubConteneurObjetList( subId, deleteList );
/* -------------------------------------------- */
buildSubConteneurObjetList(conteneurId, deleteList) {
let conteneur = this.items.find(conteneur => conteneurId == conteneur._id); // recup conteneur
if (conteneur && conteneur.type == 'conteneur') { // Si présent
for (let subId of conteneur.data.data.contenu) {
let subObj = this.items.find(subobjet => subId == subobjet._id); // recup conteneur
if (subObj && subObj.type == 'conteneur') {
this.buildSubConteneurObjetList(subId, deleteList);
}
if ( subObj) // Robust...
deleteList.push( {id: subId, conteneurId: conteneurId } );
@ -767,8 +767,8 @@ export class RdDActor extends Actor {
await this.updateOwnedItem(conteneurFixedList);
}
/* -------------------------------------------- */
async moveItemsBetweenActors( itemId, sourceActorId ) {
/* -------------------------------------------- */
async moveItemsBetweenActors(itemId, sourceActorId) {
let itemsList = []
let sourceActor = game.actors.get( sourceActorId );
itemsList.push( {id: itemId, conteneurId: undefined }); // Init list
@ -797,8 +797,8 @@ export class RdDActor extends Actor {
}
}
/* -------------------------------------------- */
detectSurEncombrement( ) {
/* -------------------------------------------- */
detectSurEncombrement() {
let maxEnc = 0;
if ( this.data.type == 'vehicule')
maxEnc = this.data.data.capacite_encombrement;
@ -1155,7 +1155,7 @@ export class RdDActor extends Actor {
}
result.newValue = Math.max(0, result.newValue);
if (inc > 0) { // le max d'endurance s'applique seulement à la récupération
result.newValue = Math.min(result.newValue, this._computeEnduranceMax())
result.newValue = Math.min(result.newValue, this._computeEnduranceMax())
}
if (data.value - result.newValue > 1) {
// Peut-être sonné si 2 points d'endurance perdus d'un coup
@ -2211,24 +2211,24 @@ export class RdDActor extends Actor {
this.ajouterBlessure(encaissement); // Will upate the result table
const perteVie = await this.santeIncDec("vie", - encaissement.vie);
const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, (encaissement.critiques > 0));
this.computeEtatGeneral();
this.sheet.render(false);
let santeActuelle = duplicate(this.data.data.sante);
encaissement.alias = this.data.name;
encaissement.hasPlayerOwner = this.hasPlayerOwner;
encaissement.resteEndurance = santeActuelle.endurance.value
encaissement.sonne = perteEndurance.sonne;
encaissement.jetEndurance = perteEndurance.jetEndurance,
encaissement.jetEndurance = perteEndurance.jetEndurance;
encaissement.endurance = santeOrig.endurance.value - perteEndurance.newValue;
encaissement.vie = santeOrig.vie.value - perteVie.newValue;
ChatUtility.createChatWithRollMode(this.name, {
roll: encaissement.roll,
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.html', encaissement)
});
roll: encaissement.roll,
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-resultat-encaissement.html', encaissement)
});
if (!encaissement.hasPlayerOwner && encaissement.endurance != 0) {
encaissement = duplicate(encaissement);