#3 Améliorations fiche

This commit is contained in:
2020-11-24 18:39:27 +01:00
parent ba66f79f63
commit d3111f6d28
6 changed files with 37 additions and 36 deletions

View File

@ -72,7 +72,7 @@ export class RdDActorSheet extends ActorSheet {
// To avoid armour and so on...
data.data.combat = duplicate( RdDUtility.checkNull(data.itemsByType['arme']));
data.data.combat = RdDUtility.finalizeArmeList( data.data.combat )
data.data.combat = RdDUtility.finalizeArmeList( data.data.combat, data.competenceByCategory );
if (data.competenceByCategory && data.competenceByCategory.melee) {
//Specific case for Esquive and Corps à Corps

View File

@ -28,10 +28,10 @@ export class RdDDice {
case "blindroll": //GM only
blind = true;
case "gmroll": //GM + rolling player
whisper = ChatUtility.getUsersIds(user => user.isGM);
whisper = ChatUtility.getUsers(user => user.isGM);
break;
case "roll": //everybody
whisper = ChatUtility.getUsersIds(user => user.active);
whisper = ChatUtility.getUsers(user => user.active);
break;
case "selfroll":
whisper = [game.user._id];

View File

@ -339,7 +339,7 @@ export class RdDUtility {
/* -------------------------------------------- */
/** Retourne une liste triée d'armes avec le split arme1 main / arme 2 main */
static finalizeArmeList( armeList ) {
static finalizeArmeList( armeList, competenceByCategory ) {
// Gestion des armes 1/2 mains
let arme2mains = []; // Tableau contenant la duplication des armes 1m/2m
for (const arme of armeList) {
@ -348,7 +348,7 @@ export class RdDUtility {
let arme2main = duplicate(arme);
arme2main.data.dommages = arme2main.data.dommages.split("/")[1]; // Existence temporaire uniquement dans la liste des armes, donc OK
arme2main.data.competence = arme2main.data.competence.replace(" 1 main", " 2 mains"); // Replace !
for ( const melee of data.competenceByCategory.melee ) {
for ( const melee of competenceByCategory.melee ) {
if (melee.name == arme2main.data.competence )
arme2main.data.niveau = melee.data.niveau
}