Merge branch 'v1.5-cauchemar' into 'v1.5'
Fix erreur sur entité de cauchemar See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!312
This commit is contained in:
commit
397d3b6edc
@ -1288,6 +1288,10 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
computeMalusSurEncombrement() {
|
computeMalusSurEncombrement() {
|
||||||
|
switch (this.type) {
|
||||||
|
case 'entite': case 'vehicule':
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return Math.min(0, this.getEncombrementMax() - Math.ceil(Number(this.getEncTotal())));
|
return Math.min(0, this.getEncombrementMax() - Math.ceil(Number(this.getEncTotal())));
|
||||||
}
|
}
|
||||||
getMessageSurEncombrement(){
|
getMessageSurEncombrement(){
|
||||||
@ -1295,9 +1299,14 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getEncombrementMax() {
|
getEncombrementMax() {
|
||||||
return (this.data.type == 'vehicule')
|
switch (this.type){
|
||||||
? Misc.templateData(this).capacite_encombrement
|
case 'vehicule':
|
||||||
: Misc.templateData(this).attributs.encombrement.value;
|
return Misc.templateData(this).capacite_encombrement;
|
||||||
|
case 'entite':
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return Misc.templateData(this).attributs.encombrement.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -3593,7 +3602,8 @@ export class RdDActor extends Actor {
|
|||||||
10: Math.floor(fortuneTotale / 10) % 10, // bronze
|
10: Math.floor(fortuneTotale / 10) % 10, // bronze
|
||||||
1: fortuneTotale % 10 // étain
|
1: fortuneTotale % 10 // étain
|
||||||
}
|
}
|
||||||
let updates = []
|
console.log('RdDActor.optimizeArgent', fortuneTotale, 'nouvelleFortune', nouvelleFortune, 'monnaie_par_valeur',parValeur);
|
||||||
|
let updates = [];
|
||||||
for (const [valeur, nombre] of Object.entries(nouvelleFortune)) {
|
for (const [valeur, nombre] of Object.entries(nouvelleFortune)) {
|
||||||
updates.push({ _id: parValeur[valeur].id, 'data.quantite': nombre });
|
updates.push({ _id: parValeur[valeur].id, 'data.quantite': nombre });
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ export class ChatUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getUsers(filter) {
|
static getUsers(filter) {
|
||||||
return game.users.filter(filter).map(user => user.data._id);
|
return Misc.getUsers().filter(filter).map(user => user.data._id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -134,16 +134,17 @@ export class Misc {
|
|||||||
return Misc.firstConnectedGM()?.id ?? game.user.id;
|
return Misc.firstConnectedGM()?.id ?? game.user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getActiveUser(id) {
|
static getUsers() {
|
||||||
return game.users.entities.find(u => u.id == id && u.active);
|
return game.version ? game.users : game.users.entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getActiveUser(id) {
|
||||||
|
return Misc.getUsers().find(u => u.id == id && u.active);
|
||||||
|
}
|
||||||
|
|
||||||
static firstConnectedGM() {
|
static firstConnectedGM() {
|
||||||
if (game.version){
|
return Misc.getUsers().filter(u => u.isGM && u.active).sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active);
|
||||||
return game.users.filter(u => u.isGM && u.active)[0];
|
|
||||||
} else {
|
|
||||||
return game.users.entities.sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -155,7 +156,7 @@ export class Misc {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static findPlayer(name) {
|
static findPlayer(name) {
|
||||||
return Misc.findFirstLike(name, game.users, { description: 'joueur' });
|
return Misc.findFirstLike(name, Misc.getUsers(), { description: 'joueur' });
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -434,17 +434,17 @@ table {border: 1px solid #7a7971;}
|
|||||||
border-bottom: 1px solid #BBB;
|
border-bottom: 1px solid #BBB;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blessure-inactive{
|
.blessure-inactive {
|
||||||
color:rgba(150, 150, 150, 0.4)
|
color:rgba(150, 150, 150, 0.4)
|
||||||
}
|
}
|
||||||
.blessure-active-legere{
|
.blessure-active-legere {
|
||||||
color:rgba(60, 60, 60, 0.9);
|
color:rgba(60, 60, 60, 0.9);
|
||||||
text-shadow: rgba(60, 60, 60, 0.7);
|
text-shadow: rgba(60, 60, 60, 0.7);
|
||||||
}
|
}
|
||||||
.blessure-active-grave{
|
.blessure-active-grave {
|
||||||
color:rgba(218, 126, 21, 0.9);
|
color:rgba(218, 126, 21, 0.9);
|
||||||
}
|
}
|
||||||
.blessure-active-critique{
|
.blessure-active-critique {
|
||||||
color:rgba(173, 36, 26, 0.9);
|
color:rgba(173, 36, 26, 0.9);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
8
test/README.md
Normal file
8
test/README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Quelques notes pour les tests
|
||||||
|
|
||||||
|
# Commandes utiles
|
||||||
|
|
||||||
|
Dans la console dans les "devtools" de Chrome, quelques commandes sont utiles:
|
||||||
|
|
||||||
|
* `CONFIG.debug.hooks = true` permet de logger les appels des hooks et les objets passés
|
||||||
|
* `game.system.rdd.TMRUtility.setForceRencontre('changeur', 3)` pour forcer une rencontre avec un changeur de rêves
|
Loading…
Reference in New Issue
Block a user