Various fixes

This commit is contained in:
2021-06-05 18:31:42 +02:00
parent 5373f15e92
commit 2336289f5a
4 changed files with 15 additions and 6 deletions

View File

@ -2402,12 +2402,14 @@ export class RdDActor extends Actor {
async rollCompetence(name) {
let rollData = { competence: Misc.data(this.getCompetence(name)) }
//console.log("COMP CREATURE", name, rollData, name);
if (rollData.competence.type == 'competencecreature') {
if (rollData.competence.data.iscombat) {
const arme = RdDItemCompetenceCreature.toArme(rollData.competence);
RdDCombat.createUsingTarget(this).attaque(rollData.competence, arme);
return;
}
//console.log("COMP CREATURE2");
// Fake competence pour créature
RdDItemCompetenceCreature.setRollDataCreature(rollData);
}

View File

@ -38,10 +38,11 @@ const MAX_NOMBRE_ASTRAL = 12;
export class RdDCalendrier extends Application {
getCalendrier(index) {
let month = Math.floor(index / 28) % 12;
let calendrier = {
heureRdD: 0, // Index dans heuresList
minutesRelative: 0,
moisRdD: Math.floor(index / 28) % 12,
moisRdD: month,
jour: (index - (month * 28)) + 1
}
return calendrier;
@ -168,7 +169,11 @@ export class RdDCalendrier extends Application {
/* -------------------------------------------- */
getNombreAstral(indexDate) {
const liste = this.listeNombreAstral ?? this._loadListNombreAstral();
let liste = this.listeNombreAstral ?? this._loadListNombreAstral();
if ( typeof(liste) != 'Array' || liste.length == 0 ) {
this.rebuildListeNombreAstral();
liste = this.listeNombreAstral;
}
let astralData = liste.find((nombreAstral, i) => nombreAstral.index == indexDate);
if (!astralData?.nombreAstral) {
this.rebuildListeNombreAstral();