Auto formatting

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

View File

@ -696,13 +696,13 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
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 } );
@ -768,7 +768,7 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
async moveItemsBetweenActors( itemId, sourceActorId ) {
async moveItemsBetweenActors(itemId, sourceActorId) {
let itemsList = []
let sourceActor = game.actors.get( sourceActorId );
itemsList.push( {id: itemId, conteneurId: undefined }); // Init list
@ -798,7 +798,7 @@ 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
@ -2221,14 +2221,14 @@ export class RdDActor extends Actor {
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);