Récupération de rêve optionnelle
This commit is contained in:
@ -2,6 +2,7 @@ import { ExperienceLog, XP_TOPIC } from "../actor/experience-log.js";
|
||||
import { ChatUtility } from "../chat-utility.js";
|
||||
import { Poetique } from "../poetique.js";
|
||||
import { RdDDice } from "../rdd-dice.js";
|
||||
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js";
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
|
||||
export class EffetsRencontre {
|
||||
@ -9,7 +10,7 @@ export class EffetsRencontre {
|
||||
static messager = async (dialog, context) => {
|
||||
dialog.setRencontreState('messager', TMRUtility.getTMRPortee(context.tmr.coord, context.rencontre.system.force));
|
||||
}
|
||||
|
||||
|
||||
static passeur = async (dialog, context) => {
|
||||
dialog.setRencontreState('passeur', TMRUtility.getTMRPortee(context.tmr.coord, context.rencontre.system.force));
|
||||
}
|
||||
@ -26,16 +27,25 @@ export class EffetsRencontre {
|
||||
static reve_plus_1 = async (dialog, context) => { await EffetsRencontre.$reve_plus(context.actor, 1) }
|
||||
static reve_moins_force = async (dialog, context) => { await EffetsRencontre.$reve_plus(context.actor, -context.rencontre.system.force) }
|
||||
static reve_moins_1 = async (dialog, context) => { await EffetsRencontre.$reve_plus(context.actor, -1) }
|
||||
static $reve_plus = async (actor, valeur) => { await actor.reveActuelIncDec(valeur) }
|
||||
static $reve_plus = async (actor, reve) => {
|
||||
if (!ReglesOptionnelles.isUsing("recuperation-reve") && reve < 0) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(actor.name),
|
||||
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
||||
});
|
||||
return
|
||||
}
|
||||
await actor.reveActuelIncDec(reve)
|
||||
}
|
||||
|
||||
static vie_moins_1 = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -1) }
|
||||
static vie_moins_force = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -context.rencontre.system.force) }
|
||||
static $vie_plus = async (actor, valeur) => { await actor.santeIncDec("vie", valeur) }
|
||||
|
||||
|
||||
static moral_plus_1 = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, 1) }
|
||||
static moral_moins_1 = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -1) }
|
||||
static $moral_plus = async (actor, valeur) => { await actor.moralIncDec(valeur) }
|
||||
|
||||
|
||||
static end_moins_1 = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -1) }
|
||||
static end_moins_force = async (dialog, context) => { await EffetsRencontre.$vie_plus(context.actor, -context.rencontre.system.force) }
|
||||
static $end_plus = async (actor, valeur) => { await actor.santeIncDec("endurance", valeur) }
|
||||
@ -50,8 +60,8 @@ export class EffetsRencontre {
|
||||
const perte = context.rolled.isETotal ? context.rencontre.system.force : 1;
|
||||
await context.actor.chanceActuelleIncDec("fatigue", -perte);
|
||||
}
|
||||
|
||||
static xp_sort_force = async (dialog, context) => {
|
||||
|
||||
static xp_sort_force = async (dialog, context) => {
|
||||
let competence = context.competence;
|
||||
if (competence) {
|
||||
const fromXpSort = Number(competence.system.xp_sort);
|
||||
@ -60,7 +70,7 @@ export class EffetsRencontre {
|
||||
await ExperienceLog.add(this, XP_TOPIC.XPSORT, fromXpSort, toXpSort, `${competence.name} - ${context.rencontre.name} en TMR`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static stress_plus_1 = async (dialog, context) => {
|
||||
await context.actor.addCompteurValue('stress', 1, `Rencontre d'un ${context.rencontre.name} en TMR`);
|
||||
}
|
||||
@ -75,7 +85,7 @@ export class EffetsRencontre {
|
||||
|
||||
static demireve_rompu = async (dialog, context) => {
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
|
||||
static sort_aleatoire = async (dialog, context) => {
|
||||
context.sortReserve = await RdDDice.rollOneOf(context.actor.itemTypes['sortreserve']);
|
||||
@ -128,7 +138,7 @@ export class EffetsRencontre {
|
||||
|
||||
static regain_seuil = async (dialog, context) => {
|
||||
await context.actor.regainPointDeSeuil()
|
||||
}
|
||||
}
|
||||
|
||||
static async $reinsertion(dialog, actor, filter) {
|
||||
const newTMR = await TMRUtility.getTMRAleatoire(filter);
|
||||
|
Reference in New Issue
Block a user