Merge branch 'master-fixes' into 'master'

Fix détermination nombre astral

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!184
This commit is contained in:
Leratier Bretonnien 2021-04-01 05:41:36 +00:00
commit 965e45cead
6 changed files with 39 additions and 54 deletions

View File

@ -49,20 +49,13 @@ export class RdDAlchimie {
}
/* -------------------------------------------- */
static getDifficulte( aspects ) {
let aspectsArray = aspects.split('-');
let diff = 0;
let nbDifferent = 0;
let aspectsHash = {}
for (let colconst of aspectsArray) {
if ( aspectsHash[colconst] ){ // Deja present, augmente difficulté de 1
diff -= 1;
} else {
nbDifferent++;
aspectsHash[colconst] = colconst; // Keep track
static getDifficulte(aspects) {
let elements = aspects.split('-');
let composantes = elements.length;
let distincts = Object.keys(Misc.classifyFirst(elements, it => it)).length;
if (distincts == 1) {
composantes--;
}
}
diff = diff - ((nbDifferent>1) ? nbDifferent : 0); // Ca doit marcher ....
return Math.min(0, diff); // Pour être sur
return Math.min(0, -composantes);
}
}

View File

@ -199,7 +199,7 @@ export class RdDCalendrier extends Application {
/* -------------------------------------------- */
syncPlayerTime(calendrier) {
this.calendrier = duplicate(calendrier); // Local copy update
this.updateDisplay(); // Then update
this.updateDisplay();
}
/* -------------------------------------------- */
@ -247,21 +247,19 @@ export class RdDCalendrier extends Application {
console.log(request);
let jourDiff = this.getLectureAstrologieDifficulte(request.date);
let niveau = Number(request.astrologie.data.niveau) + Number(request.conditions) + Number(jourDiff) + Number(request.etat);
let rolled = await RdDResolutionTable.rollData({
let rollData= {
caracValue: request.carac_vue,
finalLevel: niveau,
showDice: false
});
};
await RdDResolutionTable.rollData(rollData);
let nbAstral = this.getNombreAstral(request.date);
let nbAstralFaux = nbAstral;
request.rolled = rollData.rolled;
request.isValid = true;
request.rolled = rolled;
if (!rolled.isSuccess) {
if (!request.rolled.isSuccess) {
request.isValid = false;
while (nbAstralFaux == nbAstral) {
nbAstralFaux = new Roll("1d12").roll().total;
}
nbAstral = nbAstralFaux;
let nbAstralFaux = new Roll("1d11").evaluate().total;
nbAstral = nbAstral==nbAstralFaux ? 12 : nbAstralFaux;
// Mise à jour des nombres astraux du joueur
let astralData = this.listeNombreAstral.find((nombreAstral, i) => nombreAstral.index == request.date);
astralData.valeursFausses.push({ actorId: request.id, nombreAstral: nbAstralFaux });
@ -338,7 +336,7 @@ export class RdDCalendrier extends Application {
if (game.user.isGM) {
dateHTML = dateHTML + " - NA: " + this.getCurrentNombreAstral();
}
for (let handle of document.getElementsByClassName("calendar-move-handle")) {
for (let handle of document.getElementsByClassName("calendar-date-rdd")) {
handle.innerHTML = dateHTML;
}
for (let heure of document.getElementsByClassName("calendar-heure-texte")) {

View File

@ -1093,12 +1093,7 @@ ul, li {
.calendar-date-rdd {
font-family: "GoudyAcc";
color: #CCC;
font-weight: bold;
font-size: 1.10rem;
opacity: 90;
}
#calendar-move-handle {
font-family: "GoudyAcc";
font-size: 13px;
line-height: 1;
text-align: center;

View File

@ -461,8 +461,19 @@
{{!-- Connaissances Tab --}}
<div class="tab connaissances" data-group="primary" data-tab="connaissances">
<span class="item-name"><a class="creer-une-oeuvre">Créer une oeuvre</a></span>
<h3>Oeuvres diverses :</h3>
<h3>Tâches</h3><a class='creer-tache'>Créer une nouvelle Tâche</a>
<ul class="item-list alterne-list">
{{#each taches as |tache id|}}
<li class="item flexrow list-item" data-item-id="{{tache._id}}"><span class="competence-title tache-label"><a>{{tache.name}} ({{tache.data.points_de_tache_courant}}/{{tache.data.points_de_tache}})</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<hr>
<h3>Oeuvres diverses :</h3><a class="creer-une-oeuvre">Créer une oeuvre</a>
<ul class="item-list alterne-list">
{{#each data.chants as |chant id|}}
<li class="item flexrow list-item" data-item-id="{{chant._id}}"><span>Chant</span><span class="competence-title chant-label"><a>{{chant.name}} (niveau {{chant.data.niveau}})</a></span>
@ -527,18 +538,9 @@
</li>
{{/each}}
</ul>
<h3>Tâches</h3><a class='creer-tache'>Créer une nouvelle Tâche</a>
<ul class="item-list alterne-list">
{{#each data.taches as |tache id|}}
<li class="item flexrow list-item" data-item-id="{{tache._id}}"><span class="competence-title tache-label"><a>{{tache.name}} ({{tache.data.points_de_tache_courant}}/{{tache.data.points_de_tache}})</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<hr>
<h3>Astrologie</h3>
<span class="astrologie-label"><a id="jet-astrologie">Astrologie : Nombres Astraux</a></span>
</div>
{{!-- hautreve Tab --}}
@ -576,9 +578,6 @@
{{/if}}
</span>
</li>
<li class="item flexrow" >
<span class="astrologie-label"><a id="jet-astrologie">Astrologie : Nombres Astraux</a></span>
</li>
</ul>
</div>
<hr>

View File

@ -1,6 +1,6 @@
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.data.competence}}" />
<h4>
{{alias}} tente de chanter la chanson : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
{{alias}} tente de chanter : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
</h4>
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
<hr>

View File

@ -24,16 +24,16 @@
<label>Exotisme</label>
<input class="attribute-value" type="text" name="data.exotisme" value="{{data.exotisme}}" data-dtype="Number"/>
</div>
<div class="form-group">
<label>Référence / Auteur</label>
<input class="attribute-value" type="text" name="data.reference" value="{{data.reference}}" data-dtype="String"/>
</div>
<div class="flexcol">
<span><label>Ingrédients : </label></span>
<div class="form-group editor">
{{editor content=data.ingredients target="data.ingredients" button=true owner=owner editable=editable}}
</div>
</div>
<div class="form-group">
<label>Référence / Auteur</label>
<input class="attribute-value" type="text" name="data.reference" value="{{data.reference}}" data-dtype="String"/>
</div>
<div class="flexcol">
<span><label>Description : </label></span>
<div class="form-group editor">