Compare commits
No commits in common. "633638a9abfc3577965ee1bfafac10ffb093d936" and "54785f0c3a01a1904895ba0499b8b2469be19c5d" have entirely different histories.
633638a9ab
...
54785f0c3a
@ -243,7 +243,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
await this.resetInfoSommeil()
|
await this.resetInfoSommeil()
|
||||||
ChatMessage.create(message);
|
ChatMessage.create(message);
|
||||||
setTimeout(() => this.sheet.render(), 20)
|
this.sheet.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
async _recuperationSante(message) {
|
async _recuperationSante(message) {
|
||||||
@ -299,7 +299,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
ChatMessage.create(message);
|
ChatMessage.create(message);
|
||||||
}
|
}
|
||||||
await this.resetInfoSommeil();
|
await this.resetInfoSommeil();
|
||||||
setTimeout(() => this.sheet.render(), 20)
|
this.sheet.render(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,9 +442,10 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
message.content += 'Vous ne trouvez pas le sommeil';
|
message.content += 'Vous ne trouvez pas le sommeil';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let dormi = await this.$dormirDesHeures(message, heures, options);
|
let jetsReve = [];
|
||||||
if (dormi.jetsReve.length > 0) {
|
let dormi = await this.dormirDesHeures(jetsReve, message, heures, options);
|
||||||
message.content += `Vous récupérez ${dormi.jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `;
|
if (jetsReve.length > 0) {
|
||||||
|
message.content += `Vous récupérez ${jetsReve.map(it => it < 0 ? '0 (réveil)' : it).reduce(Misc.joining("+"))} Points de rêve. `;
|
||||||
}
|
}
|
||||||
if (dormi.etat == 'eveil') {
|
if (dormi.etat == 'eveil') {
|
||||||
await this.reveilReveDeDragon(message, dormi.heures);
|
await this.reveilReveDeDragon(message, dormi.heures);
|
||||||
@ -460,7 +461,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
await this.dormirChateauDormant();
|
await this.dormirChateauDormant();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setTimeout(() => this.sheet.render(), 20)
|
this.sheet.render(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,18 +472,18 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async $dormirDesHeures(message, heures, options) {
|
async dormirDesHeures(jetsReve, message, heures, options) {
|
||||||
const dormi = { heures: 0, etat: 'dort', jetsReve: [] };
|
const dormi = { heures: 0, etat: 'dort' };
|
||||||
for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) {
|
for (; dormi.heures < heures && dormi.etat == 'dort'; dormi.heures++) {
|
||||||
await this.$recupererEthylisme(message);
|
await this._recupererEthylisme(message);
|
||||||
if (options.grisReve) {
|
if (options.grisReve) {
|
||||||
await this.$recupererFatigue(message);
|
await this.recupererFatigue(message);
|
||||||
}
|
}
|
||||||
else if (!this.system.sommeil?.insomnie) {
|
else if (!this.system.sommeil?.insomnie) {
|
||||||
await this.$recupererFatigue(message);
|
await this.recupererFatigue(message);
|
||||||
await this.$jetRecuperationReve(dormi, message);
|
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
||||||
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
if (dormi.etat == 'dort' && EffetsDraconiques.isDonDoubleReve(this)) {
|
||||||
dormi.etat = await this.$jetRecuperationReve(dormi, message);
|
dormi.etat = await this.jetRecuperationReve(jetsReve, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -490,36 +491,35 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async $jetRecuperationReve(dormi, message) {
|
async jetRecuperationReve(jetsReve, message) {
|
||||||
if (this.getReveActuel() < this.system.reve.seuil.value) {
|
if (this.getReveActuel() < this.system.reve.seuil.value) {
|
||||||
const reve = await RdDDice.rollTotal("1dr")
|
let reve = await RdDDice.rollTotal("1dr");
|
||||||
if (reve >= 7) {
|
if (reve >= 7) {
|
||||||
// Rêve de Dragon !
|
// Rêve de Dragon !
|
||||||
message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `;
|
message.content += `Vous faites un <strong>Rêve de Dragon</strong> de ${reve} Points de rêve qui vous réveille! `;
|
||||||
await this.combattreReveDeDragon(reve);
|
await this.combattreReveDeDragon(reve);
|
||||||
dormi.jetsReve.push(-1);
|
jetsReve.push(-1);
|
||||||
dormi.etat = 'eveil'
|
return 'eveil';
|
||||||
return
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
||||||
})
|
});
|
||||||
dormi.jetsReve.push(0)
|
jetsReve.push(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await this.reveActuelIncDec(reve)
|
await this.reveActuelIncDec(reve);
|
||||||
dormi.jetsReve.push(reve)
|
jetsReve.push(reve);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dormi.etat = 'dort'
|
return 'dort';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async $recupererEthylisme(message) {
|
async _recupererEthylisme(message) {
|
||||||
if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; }
|
if (!ReglesOptionnelles.isUsing("recuperation-ethylisme")) { return; }
|
||||||
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
|
let value = Math.min(Number.parseInt(this.system.compteurs.ethylisme.value) + 1, 1);
|
||||||
if (value <= 0) {
|
if (value <= 0) {
|
||||||
@ -549,15 +549,15 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async $recupererFatigue(message) {
|
async recupererFatigue(message) {
|
||||||
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
if (ReglesOptionnelles.isUsing("appliquer-fatigue")) {
|
||||||
let fatigue = this.system.sante.fatigue.value
|
let fatigue = this.system.sante.fatigue.value;
|
||||||
const fatigueMin = this.getFatigueMin()
|
const fatigueMin = this.getFatigueMin();
|
||||||
if (fatigue <= fatigueMin) {
|
if (fatigue <= fatigueMin) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue))
|
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue));
|
||||||
await this.update({ 'system.sante.fatigue.value': fatigue });
|
await this.update({ "system.sante.fatigue.value": fatigue });
|
||||||
if (fatigue == 0) {
|
if (fatigue == 0) {
|
||||||
message.content += "Vous êtes complêtement reposé. ";
|
message.content += "Vous êtes complêtement reposé. ";
|
||||||
}
|
}
|
||||||
@ -1800,10 +1800,8 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
};
|
};
|
||||||
RollDataAjustements.calcul(rollData, this);
|
RollDataAjustements.calcul(rollData, this);
|
||||||
await RdDResolutionTable.rollData(rollData);
|
await RdDResolutionTable.rollData(rollData);
|
||||||
await RdDRollResult.displayRollData(rollData, this)
|
|
||||||
|
|
||||||
this.gererExperience(rollData);
|
this.gererExperience(rollData);
|
||||||
|
await RdDRollResult.displayRollData(rollData, this)
|
||||||
return rollData.rolled;
|
return rollData.rolled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ export class Misc {
|
|||||||
const subset = elements.filter(options.preFilter)
|
const subset = elements.filter(options.preFilter)
|
||||||
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value))
|
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value))
|
||||||
.sort(Misc.ascending(it => options.mapper(it)))
|
.sort(Misc.ascending(it => options.mapper(it)))
|
||||||
if (subset.length == 0 && options?.onMessage) {
|
if (subset.length == 0) {
|
||||||
options.onMessage(`Pas de ${options.description} correspondant à ${value}`);
|
options.onMessage(`Pas de ${options.description} correspondant à ${value}`);
|
||||||
}
|
}
|
||||||
return subset;
|
return subset;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npx vite build",
|
"build": "npx vite build",
|
||||||
"run": "npx vite serve",
|
|
||||||
"packCompendiumsToDist": "node ./tools/packCompendiumsToDist.mjs",
|
"packCompendiumsToDist": "node ./tools/packCompendiumsToDist.mjs",
|
||||||
"packCompendiumsToPublic": "node ./tools/packCompendiumsToPublic.mjs",
|
"packCompendiumsToPublic": "node ./tools/packCompendiumsToPublic.mjs",
|
||||||
"unpackCompendiumsFromPublic": "node ./tools/unpackCompendiumsFromPublic.mjs"
|
"unpackCompendiumsFromPublic": "node ./tools/unpackCompendiumsFromPublic.mjs"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user