Jet de Stress utilise le reve actuel
renommage de updateReveActuel pour indiquer que ça applique une difference (comme santeIncDec)
This commit is contained in:
parent
5d04063579
commit
6ccc5b8d1b
@ -396,9 +396,9 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async recuperationReve(message) {
|
async recuperationReve(message) {
|
||||||
const seuil = this.data.data.reve.seuil.value;
|
const seuil = this.data.data.reve.seuil.value;
|
||||||
const reve = this.getReveActuel();
|
const reveActuel = this.getReveActuel();
|
||||||
if (reve >= seuil) {
|
if (reveActuel >= seuil) {
|
||||||
message.content += "<br>Vous avez suffisament rêvé (seuil " + seuil + ", rêve actuel "+reve+")";
|
message.content += "<br>Vous avez suffisament rêvé (seuil " + seuil + ", rêve actuel "+reveActuel+")";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let deRecuperation = await RdDDice.deDraconique();
|
let deRecuperation = await RdDDice.deDraconique();
|
||||||
@ -407,11 +407,11 @@ export class RdDActor extends Actor {
|
|||||||
{
|
{
|
||||||
// Rêve de Dragon !
|
// Rêve de Dragon !
|
||||||
message.content += "<br>Vous faites un <strong>Rêve de Dragon</strong> de " + deRecuperation + " Points de rêve";
|
message.content += "<br>Vous faites un <strong>Rêve de Dragon</strong> de " + deRecuperation + " Points de rêve";
|
||||||
message.content += this.combattreReveDeDragon(deRecuperation);
|
message.content += await this.combattreReveDeDragon(deRecuperation);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
message.content += "<br>Vous récupérez " + deRecuperation + " Points de rêve";
|
message.content += "<br>Vous récupérez " + deRecuperation + " Points de rêve";
|
||||||
this.updatePointsDeReve(deRecuperation);
|
await this.reveActuelIncDec(deRecuperation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -435,7 +435,7 @@ export class RdDActor extends Actor {
|
|||||||
if (roll.isSuccess) {
|
if (roll.isSuccess) {
|
||||||
message += "<br>Vous gagnez " + force + " points de Rêve";
|
message += "<br>Vous gagnez " + force + " points de Rêve";
|
||||||
this.updatePointDeSeuil();
|
this.updatePointDeSeuil();
|
||||||
this.updatePointsDeReve(force);
|
this.reveActuelIncDec(force);
|
||||||
}
|
}
|
||||||
if (roll.isPart) {
|
if (roll.isPart) {
|
||||||
// TODO: Dialog pour choix entre HR opu général?
|
// TODO: Dialog pour choix entre HR opu général?
|
||||||
@ -723,7 +723,7 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async updatePointsDeReve( value ) {
|
async reveActuelIncDec( value ) {
|
||||||
let reve = duplicate(this.data.data.reve.reve);
|
let reve = duplicate(this.data.data.reve.reve);
|
||||||
reve.value = Math.max(reve.value + value, 0);
|
reve.value = Math.max(reve.value + value, 0);
|
||||||
await this.update( {"data.reve.reve": reve } );
|
await this.update( {"data.reve.reve": reve } );
|
||||||
@ -921,7 +921,8 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _stressRoll() {
|
async _stressRoll() {
|
||||||
let result = await RdDResolutionTable.roll(this.data.data.carac.reve.value, 0);
|
let reveActuel = this.getReveActuel();
|
||||||
|
let result = await RdDResolutionTable.roll(reveActuel, 0);
|
||||||
console.log("_stressRoll", result);
|
console.log("_stressRoll", result);
|
||||||
switch (result.code) {
|
switch (result.code) {
|
||||||
case "sign": return { factor: 0.75, comment: " (75%): " + result.quality + " - " + result.roll + " sur " + result.score + "%" }
|
case "sign": return { factor: 0.75, comment: " (75%): " + result.quality + " - " + result.roll + " sur " + result.score + "%" }
|
||||||
@ -931,7 +932,7 @@ export class RdDActor extends Actor {
|
|||||||
case "etotal": return { factor: 0, comment: " (0%): " + result.quality + " - " + result.roll + " sur " + result.score + "%" }
|
case "etotal": return { factor: 0, comment: " (0%): " + result.quality + " - " + result.roll + " sur " + result.score + "%" }
|
||||||
case "part":
|
case "part":
|
||||||
{
|
{
|
||||||
let second = await RdDResolutionTable.roll(this.data.data.carac.reve.value, 0);
|
let second = await RdDResolutionTable.roll(reveActuel, 0);
|
||||||
console.log("_stressRoll", second);
|
console.log("_stressRoll", second);
|
||||||
switch (second.code) {
|
switch (second.code) {
|
||||||
case "part": case "sign":
|
case "part": case "sign":
|
||||||
|
Loading…
Reference in New Issue
Block a user