Fix bugs + Enhance stress
This commit is contained in:
parent
933b82e43a
commit
dbc17e580c
@ -2895,6 +2895,15 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
getHeureNaissance() {
|
||||||
|
if (this.isCreature()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const actorData = Misc.data(this);
|
||||||
|
return actorData.data.heure;
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
ajustementAstrologique() {
|
ajustementAstrologique() {
|
||||||
if (this.isCreature()) {
|
if (this.isCreature()) {
|
||||||
|
@ -344,6 +344,28 @@ export class RdDCalendrier extends Application {
|
|||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
getHeureNumber( hNum) {
|
||||||
|
let heure = Object.values(heuresDef).find(it => (it.heure) == hNum);
|
||||||
|
return heure
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
getHeuresChanceMalchance(heureNaissance) {
|
||||||
|
let heuresChancesMalchances = [];
|
||||||
|
let defHeure = this.findHeure(heureNaissance);
|
||||||
|
if (defHeure) {
|
||||||
|
let hn = defHeure.heure;
|
||||||
|
let chiffreAstral = this.getCurrentNombreAstral() ?? 0;
|
||||||
|
heuresChancesMalchances[0] = { value : "+4", heures: [this.getHeureNumber((hn + chiffreAstral) % RDD_HEURES_PAR_JOUR).label]};
|
||||||
|
heuresChancesMalchances[1] = { value : "+2", heures: [this.getHeureNumber((hn + chiffreAstral+4) % RDD_HEURES_PAR_JOUR).label,
|
||||||
|
this.getHeureNumber((hn + chiffreAstral + 8) % RDD_HEURES_PAR_JOUR).label ] };
|
||||||
|
heuresChancesMalchances[2] = { value : "-4", heures: [this.getHeureNumber((hn + chiffreAstral+6) % RDD_HEURES_PAR_JOUR).label]};
|
||||||
|
heuresChancesMalchances[3] = { value : "-2", heures: [this.getHeureNumber((hn + chiffreAstral+3) % RDD_HEURES_PAR_JOUR).label,
|
||||||
|
this.getHeureNumber((hn + chiffreAstral + 9) % RDD_HEURES_PAR_JOUR).label ]};
|
||||||
|
}
|
||||||
|
return heuresChancesMalchances;
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getAjustementAstrologique(heureNaissance, name = undefined) {
|
getAjustementAstrologique(heureNaissance, name = undefined) {
|
||||||
@ -465,13 +487,20 @@ export class RdDCalendrier extends Application {
|
|||||||
astralData.humanDate = this.getDateFromIndex(astralData.index);
|
astralData.humanDate = this.getDateFromIndex(astralData.index);
|
||||||
for (let vf of astralData.valeursFausses) {
|
for (let vf of astralData.valeursFausses) {
|
||||||
let actor = game.actors.get(vf.actorId);
|
let actor = game.actors.get(vf.actorId);
|
||||||
console.log(vf.actorId, actor);
|
|
||||||
vf.actorName = (actor) ? actor.name : "Inconnu";
|
vf.actorName = (actor) ? actor.name : "Inconnu";
|
||||||
}
|
}
|
||||||
astrologieArray.push(duplicate(astralData));
|
astrologieArray.push(duplicate(astralData));
|
||||||
}
|
}
|
||||||
|
let heuresParActeur = {};
|
||||||
|
for (let actor of game.actors) {
|
||||||
|
let heureNaissance = actor.getHeureNaissance();
|
||||||
|
if ( heureNaissance) {
|
||||||
|
heuresParActeur[actor.name] = this.getHeuresChanceMalchance(heureNaissance);
|
||||||
|
}
|
||||||
|
}
|
||||||
//console.log("ASTRO", astrologieArray);
|
//console.log("ASTRO", astrologieArray);
|
||||||
calendrierData.astrologieData = astrologieArray;
|
calendrierData.astrologieData = astrologieArray;
|
||||||
|
calendrierData.heuresParActeur = heuresParActeur;
|
||||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/calendar-astrologie-template.html', calendrierData);
|
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/calendar-astrologie-template.html', calendrierData);
|
||||||
let astrologieEditeur = new RdDAstrologieEditeur(html, this, calendrierData)
|
let astrologieEditeur = new RdDAstrologieEditeur(html, this, calendrierData)
|
||||||
astrologieEditeur.updateData(calendrierData);
|
astrologieEditeur.updateData(calendrierData);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "foundryvtt-reve-de-dragon",
|
"name": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||||
"version": "1.5.7",
|
"version": "1.5.8",
|
||||||
"manifestPlusVersion": "1.0.0",
|
"manifestPlusVersion": "1.0.0",
|
||||||
"minimumCoreVersion": "0.8.0",
|
"minimumCoreVersion": "0.8.0",
|
||||||
"compatibleCoreVersion": "0.8.9",
|
"compatibleCoreVersion": "0.8.9",
|
||||||
|
@ -26,7 +26,24 @@
|
|||||||
</td>
|
</td>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<ul>
|
||||||
|
{{#each heuresParActeur as |heuresDef name|}}
|
||||||
|
<li><strong>{{name}} </strong></li>
|
||||||
|
<ul class="list-item-margin1">
|
||||||
|
{{#each heuresDef as |heure idx|}}
|
||||||
|
<li><strong>{{heure.value}}</strong> :
|
||||||
|
{{#each heure.heures as |heureName idx|}}
|
||||||
|
{{heureName}}
|
||||||
|
{{/each}}
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user