Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fcaebe6334 | |||
| c4033707be | |||
| 8b83369d5a | |||
| e9183df59c | |||
| 45ccac3489 | |||
| c41db974ff | |||
| 875e121a09 | |||
| 12e0e6397c | |||
| 93b74574ad | |||
| 1765cb2ef9 | |||
| 0cbd7a6deb | |||
| aec4364889 | |||
| f17996b1c8 | |||
| 14a4b34bbd | |||
| 1777eced30 | |||
| 9bdda32d54 | |||
| 3fe53d7ff0 | |||
| c839d4633d | |||
| 24753bfc29 | |||
| e7acb0c4f2 | |||
| 7535e5f340 | |||
| d2326e5a25 | |||
| e2afc24601 |
37
changelog.md
37
changelog.md
@@ -1,5 +1,42 @@
|
||||
# 13.0
|
||||
|
||||
## 13.0.43 - L'urgence d'Illisys
|
||||
|
||||
- correction urgente des jets
|
||||
|
||||
## 13.0.42 - La rebellion d'Illisys
|
||||
|
||||
- on peut choisir la difficulté des jets de résistances
|
||||
- la macro signe draconique fonctionne de nouveau (ajout et suppression)
|
||||
- le Guerrier Sorde n'est pas joueur et ne cuisine pas (pas de message si compétence Jeu / Cuisine manquent)
|
||||
- Corrections V14
|
||||
- Les descriptions aléatoires fonctionnent de nouveau
|
||||
|
||||
## 13.0.41 - Le miroir d'Illisys
|
||||
|
||||
- les mode de visibilité des jets sont bien pris en compte
|
||||
|
||||
## 13.0.40 - Le miroir d'Illisys
|
||||
|
||||
- pas de stress ou de sommeil pour les personnage non liés
|
||||
|
||||
## 13.0.39 - La défense d'Illisys
|
||||
|
||||
- mise à jour de version foundry-cli
|
||||
- correction des catégories de parades des compendiums
|
||||
- des ne pouvaient pas parer (exemple: le bouclier du guerrier sorde)
|
||||
- les difficultés des jets d'attaque/défense après appel à la chance sont conservées
|
||||
- L'absence des compétences cuisine/jeu ne bloque plus l'accès à la fenêtre de jets (cas des invocations)
|
||||
|
||||
## 13.0.38 - L'urgence d'Illisys
|
||||
|
||||
- Corrections v14
|
||||
- on peut utiliser les commandes foundry dans le tchat (par exemple, /roll 1d6)
|
||||
- les dés customisés Dice-So-Nice (heure, rencontres, dé draconique) fonctionnent
|
||||
- Le Haut-rêve est de nouveau proposé dans les options d'initiative
|
||||
- Nouvelle règle optionnelle: choisir si seules les armes équipées sont proposées en combat
|
||||
- L'appel à la chance utilise la nouvelle fenêtre de jet de dés
|
||||
|
||||
## 13.0.37 - Le bonheur des zyglutes d'Illisys
|
||||
|
||||
- Corrections v14
|
||||
|
||||
@@ -216,7 +216,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
|
||||
// Points de reve actuel
|
||||
this.html.find('.roll-reve-actuel').click(async event => await this.actor.rollReveActuel({ resistance: false }))
|
||||
this.html.find('.button-reve-resistance').click(async event => await this.actor.rollReveActuel({ diff: -8, resistance: true }))
|
||||
this.html.find('.button-reve-resistance').click(async event => await this.actor.rollReveResistance())
|
||||
this.html.find('.action-empoignade').click(async event => await RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
|
||||
|
||||
this.html.find('.roll-arme').click(async event => {
|
||||
|
||||
@@ -47,11 +47,7 @@ import { RdDRollResult } from "./rdd-roll-result.js";
|
||||
import { RdDInitiative } from "./initiative.mjs";
|
||||
import RollDialog from "./roll/roll-dialog.mjs";
|
||||
import { OptionsAvancees, ROLL_DIALOG_V2 } from "./settings/options-avancees.js";
|
||||
import { ROLL_TYPE_JEU, ROLL_TYPE_MEDITATION, ROLL_TYPE_SORT } from "./roll/roll-constants.mjs";
|
||||
import { PART_TACHE } from "./roll/roll-part-tache.mjs";
|
||||
import { PART_COMP } from "./roll/roll-part-comp.mjs";
|
||||
import { PART_OEUVRE } from "./roll/roll-part-oeuvre.mjs";
|
||||
import { PART_CUISINE } from "./roll/roll-part-cuisine.mjs";
|
||||
import { ROLL_TYPE_COMP, ROLL_TYPE_CUISINE, ROLL_TYPE_JEU, ROLL_TYPE_MEDITATION, ROLL_TYPE_OEUVRE, ROLL_TYPE_SORT, ROLL_TYPE_APPEL_CHANCE, ROLL_TYPE_TACHE } from "./roll/roll-constants.mjs";
|
||||
import { RdDPossessionV2 } from "./rdd-possession-v2.mjs";
|
||||
import { Apprecier, MORAL, SITUATION_MORAL } from "./moral/apprecier.mjs";
|
||||
import { Distance } from "./combat/distance.mjs";
|
||||
@@ -140,13 +136,14 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
.reduce(Misc.sum(), 0);
|
||||
}
|
||||
|
||||
listActions({ isAttaque = false, isEquipe = false }) {
|
||||
listActions() {
|
||||
// Recupération des attaques
|
||||
const actions = this.listActionsAttaque()
|
||||
.filter(it => !isEquipe || it.arme.system.equipe)
|
||||
const actions = ReglesOptionnelles.isUsing('armes-equipees')
|
||||
? this.listActionsAttaque().filter(action => action.equipe)
|
||||
: this.listActionsAttaque()
|
||||
|
||||
if (!isAttaque && this.system.attributs.hautrevant.value) {
|
||||
actions.push({ label: "Draconic", action: 'haut-reve', initOnly: true })
|
||||
if (this.system.attributs.hautrevant.value) {
|
||||
actions.push({ label: "Draconic", action: 'haut-reve', initOnly: true, equipe: true })
|
||||
}
|
||||
return actions
|
||||
}
|
||||
@@ -952,7 +949,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async distribuerStress(compteur, valeur, motif) {
|
||||
if (game.user.isGM && this.hasPlayerOwner) {
|
||||
if (game.user.isGM && this.isPersonnageJoueur()) {
|
||||
switch (compteur) {
|
||||
case 'stress': case 'experience':
|
||||
await this.addCompteurValue(compteur, valeur, motif);
|
||||
@@ -1876,7 +1873,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [PART_COMP], current: PART_COMP },
|
||||
type: { allowed: [ROLL_TYPE_COMP], current: ROLL_TYPE_COMP },
|
||||
selected: {
|
||||
carac: { key: caracName },
|
||||
comp: { key: compName, forced: options.forced },
|
||||
@@ -1915,7 +1912,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
selected: { tache: { key: tache.id, forced: options.forced } },
|
||||
type: { allowed: [PART_TACHE], current: PART_TACHE }
|
||||
type: { allowed: [ROLL_TYPE_TACHE], current: ROLL_TYPE_TACHE }
|
||||
}
|
||||
return await RollDialog.create(rollData, options)
|
||||
}
|
||||
@@ -2128,18 +2125,22 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollAppelChance(onSuccess = () => { }, onEchec = () => { }) {
|
||||
await this.openRollDialog({
|
||||
name: 'appelChance',
|
||||
label: 'Appel à la chance',
|
||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.hbs',
|
||||
rollData: { selectedCarac: this.getCaracByName('chance-actuelle'), surprise: '' },
|
||||
callbacks: [{ action: r => this.$appelChanceResult(r, onSuccess, onEchec) }]
|
||||
});
|
||||
|
||||
return await RollDialog.create(
|
||||
{
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [ROLL_TYPE_APPEL_CHANCE], current: ROLL_TYPE_APPEL_CHANCE },
|
||||
},
|
||||
{
|
||||
onRollDone: (dialog, roll) => RollDialog.onRollDoneClose(dialog, roll),
|
||||
callbacks: [
|
||||
async roll => await this.$onAppelChance(roll, onSuccess, onEchec)
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async $appelChanceResult(rollData, onSuccess, onEchec) {
|
||||
await RdDRollResult.displayRollData(rollData, this, 'chat-resultat-appelchance.hbs')
|
||||
async $onAppelChance(rollData, onSuccess, onEchec) {
|
||||
if (rollData.rolled.isSuccess) {
|
||||
await this.setFlag(SYSTEM_RDD, 'utilisationChance', true);
|
||||
await this.chanceActuelleIncDec(-1);
|
||||
@@ -2474,10 +2475,10 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
/* -------------------------------------------- */
|
||||
async equiperObjet(item) {
|
||||
if (item?.isEquipable()) {
|
||||
const isEquipe = !item.system.equipe;
|
||||
await item.update({ "system.equipe": isEquipe })
|
||||
const newEquipe = !item.system.equipe;
|
||||
await item.update({ "system.equipe": newEquipe })
|
||||
this.computeEncTotal()
|
||||
if (isEquipe)
|
||||
if (newEquipe)
|
||||
await this.verifierForceMin(item)
|
||||
}
|
||||
}
|
||||
@@ -3014,7 +3015,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
selected: { oeuvre: { key: oeuvre.id } },
|
||||
type: { allowed: [PART_OEUVRE], current: PART_OEUVRE, },
|
||||
type: { allowed: [ROLL_TYPE_OEUVRE], current: ROLL_TYPE_OEUVRE, },
|
||||
}
|
||||
return await RollDialog.create(rollData)
|
||||
}
|
||||
@@ -3116,7 +3117,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [PART_CUISINE], current: PART_CUISINE },
|
||||
type: { allowed: [ROLL_TYPE_CUISINE], current: ROLL_TYPE_CUISINE },
|
||||
selected: {
|
||||
cuisine: { key: recette.id }
|
||||
}
|
||||
@@ -3166,7 +3167,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
if (item.getUtilisationCuisine() == 'brut' && OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [PART_CUISINE], current: PART_CUISINE },
|
||||
type: { allowed: [ROLL_TYPE_CUISINE], current: ROLL_TYPE_CUISINE },
|
||||
selected: {
|
||||
cuisine: { key: item.id }
|
||||
}
|
||||
|
||||
@@ -26,9 +26,8 @@ import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, CATEGORIES_COMPETENCES_CREATURES } fr
|
||||
import { RollDataAjustements } from "../rolldata-ajustements-v1.js";
|
||||
import { MappingCreatureArme } from "../item/mapping-creature-arme.mjs";
|
||||
import RollDialog from "../roll/roll-dialog.mjs";
|
||||
import { DEFAULT_ROLL_TYPES, DIFF, ROLL_TYPE_ATTAQUE } from "../roll/roll-constants.mjs";
|
||||
import { DEFAULT_ROLL_TYPES, DIFF, ROLL_TYPE_ATTAQUE, ROLL_TYPE_COMP, ROLL_TYPE_REVE_RESISTANCE } from "../roll/roll-constants.mjs";
|
||||
import { OptionsAvancees, ROLL_DIALOG_V2 } from "../settings/options-avancees.js";
|
||||
import { PART_COMP } from "../roll/roll-part-comp.mjs";
|
||||
import { RdDInitiative } from "../initiative.mjs";
|
||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||
import { RdDPossessionV2 } from "../rdd-possession-v2.mjs";
|
||||
@@ -145,7 +144,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
}
|
||||
}
|
||||
|
||||
listActions({ isAttaque = false, isEquipe = false }) {
|
||||
listActions() {
|
||||
return this.itemTypes[ITEM_TYPES.competencecreature]
|
||||
.filter(it => it.isAttaque())
|
||||
.map(it => it.attaqueCreature())
|
||||
@@ -156,7 +155,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
async remiseANeuf() { }
|
||||
async ajoutExperience(rollData, hideChatMessage = 'show') { }
|
||||
|
||||
computeResumeBlessure() { return []}
|
||||
computeResumeBlessure() { return [] }
|
||||
countBlessures(filter = it => !it.isContusion()) { return 0 }
|
||||
async santeIncDec(name, inc, isCritique) { }
|
||||
|
||||
@@ -317,7 +316,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
const competence = this.getCompetence(compName);
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: DEFAULT_ROLL_TYPES, current: PART_COMP },
|
||||
type: { allowed: DEFAULT_ROLL_TYPES, current: ROLL_TYPE_COMP },
|
||||
selected: {
|
||||
carac: { key: caracName },
|
||||
comp: { key: competence.name },
|
||||
@@ -384,7 +383,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: DEFAULT_ROLL_TYPES,
|
||||
current: PART_COMP,
|
||||
current: ROLL_TYPE_COMP,
|
||||
},
|
||||
selected: {
|
||||
diff: { type: DIFF.DEFAUT }
|
||||
@@ -412,13 +411,33 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
})
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollReveResistance(diff = -8) {
|
||||
return await RollDialog.create(
|
||||
{
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: [ROLL_TYPE_REVE_RESISTANCE],
|
||||
current: ROLL_TYPE_REVE_RESISTANCE,
|
||||
resistance: true
|
||||
},
|
||||
selected: {
|
||||
carac: { key: CARACS.REVE_ACTUEL, forced: true },
|
||||
comp: { key: undefined, forced: true },
|
||||
diff: { type: DIFF.DEFAUT, value: diff }
|
||||
}
|
||||
},
|
||||
{
|
||||
onRollDone: (dialog, roll) => RollDialog.onRollDoneClose(dialog, roll)
|
||||
})
|
||||
}
|
||||
|
||||
async rollReveActuel({ diff = 0, resistance = false }) {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: [PART_COMP],
|
||||
current: PART_COMP,
|
||||
allowed: [ROLL_TYPE_REVE_RESISTANCE],
|
||||
current: ROLL_TYPE_REVE_RESISTANCE,
|
||||
resistance: resistance
|
||||
},
|
||||
selected: {
|
||||
@@ -440,8 +459,8 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: {
|
||||
allowed: options.resistance ? [PART_COMP] : DEFAULT_ROLL_TYPES,
|
||||
current: PART_COMP,
|
||||
allowed: options.resistance ? [ROLL_TYPE_COMP] : DEFAULT_ROLL_TYPES,
|
||||
current: options.resistance ? ROLL_TYPE_COMP : ROLL_TYPE_COMP,
|
||||
resistance: options.resistance
|
||||
},
|
||||
selected: {
|
||||
|
||||
@@ -914,11 +914,7 @@ export class RdDBaseActor extends Actor {
|
||||
isActorCombat() { return false }
|
||||
getCaracInit(competence) { return 0 }
|
||||
|
||||
listAttaques() {
|
||||
return this.listActions({ isAttaque: true, isEquipe: false })
|
||||
}
|
||||
|
||||
listActions({ isAttaque = false, isEquipe = false }) { return [] }
|
||||
listActions() { return [] }
|
||||
|
||||
listActionsPossessions() {
|
||||
return this.itemTypes[ITEM_TYPES.possession]
|
||||
|
||||
@@ -5,25 +5,80 @@ import { RdDDice } from "../../rdd-dice.js";
|
||||
import { RdDNameGen } from "../../rdd-namegen.js";
|
||||
import { RdDTimestamp } from "../../time/rdd-timestamp.js";
|
||||
|
||||
const PATHS = [
|
||||
'name',
|
||||
'system.sexe',
|
||||
'system.age',
|
||||
'system.taille',
|
||||
'system.poids',
|
||||
'system.main',
|
||||
'system.heure',
|
||||
'system.cheveux',
|
||||
'system.yeux'
|
||||
]
|
||||
|
||||
const RANDOM_VALUES = {
|
||||
'system.sexe': { 'masculin': 1, 'féminin': 1 },
|
||||
'system.main': { 'droitier': 51, 'gaucher': 15, 'ambidextre': 6 },
|
||||
'system.cheveux': { 'noirs': 2, 'bruns': 5, 'châtains': 3, 'châtain clair': 5, 'blonds': 4, 'blond platine': 1, 'roux carotte': 1, 'roux cuivré': 3, 'chauve': 1 },
|
||||
'system.yeux': { 'noirs': 2, 'noisette': 3, 'brun-vert': 4, 'verts': 3, 'bleu clair': 3, 'bleu gris': 2, 'gris': 1, 'mauves': 1, 'indigos': 1 },
|
||||
async function randomFrom(values) {
|
||||
const max = Object.values(values).reduce(Misc.sum(), 0)
|
||||
const total = await RdDDice.rollTotal(`1d${max}`)
|
||||
let sum = 0
|
||||
for (let entry of Object.entries(values)) {
|
||||
sum = sum + entry[1]
|
||||
if (sum >= total) {
|
||||
return entry[0]
|
||||
}
|
||||
}
|
||||
return Object.keys(values)[0]
|
||||
}
|
||||
|
||||
async function randomTailleCm(taille) {
|
||||
const infoTaille = RdDCarac.getCaracDerivee(taille)
|
||||
const infoTailleSup = RdDCarac.getCaracDerivee(taille + 1)
|
||||
const variation = (infoTailleSup.taille - infoTaille.taille) + Math.floor((infoTaille.poidsMax - infoTaille.poidsMin) / 2)
|
||||
const base = infoTaille.taille
|
||||
const total = await RdDDice.rollTotal(`1d${variation} -1d ${variation} + ${base}`)
|
||||
const cm = total % 100
|
||||
const dm = cm < 10 ? '0' : ''
|
||||
const m = (total - cm) / 100
|
||||
return `${m}m${dm}${cm}`
|
||||
}
|
||||
|
||||
async function randomPoidsKg(taille) {
|
||||
const infoTaille = RdDCarac.getCaracDerivee(taille)
|
||||
const range = infoTaille.poidsMax - infoTaille.poidsMin + 1
|
||||
const total = await RdDDice.rollTotal(`1d${range} + ${infoTaille.poidsMin}`)
|
||||
return total + ' kg'
|
||||
}
|
||||
|
||||
async function randomHeure() {
|
||||
return RdDTimestamp.defHeure(await RdDDice.rollHeure({ rollMode: "selfroll", showDice: SHOW_DICE })).key
|
||||
}
|
||||
|
||||
const CONTROL_UNKNOWN = { name: 'unknown', path: '', getter: (act) => { undefined }, random: async act => undefined }
|
||||
const TABLE_SEXES = { 'masculin': 1, 'féminin': 1 };
|
||||
const TABLE_MAINS = { 'droitier': 51, 'gaucher': 15, 'ambidextre': 6 };
|
||||
const TABLE_COULEURS_CHEVEUX = {
|
||||
'noirs': 2,
|
||||
'bruns': 5,
|
||||
'châtains': 3,
|
||||
'châtain clair': 5,
|
||||
'blonds': 4,
|
||||
'blond platine': 1,
|
||||
'roux carotte': 1,
|
||||
'roux cuivré': 3,
|
||||
'chauve': 1
|
||||
};
|
||||
const TABLE_COULEURS_YEUX = {
|
||||
'noirs': 2,
|
||||
'noisette': 3,
|
||||
'brun-vert': 4,
|
||||
'verts': 3,
|
||||
'bleu clair': 3,
|
||||
'bleu gris': 2,
|
||||
'gris': 1,
|
||||
'mauves': 1,
|
||||
'indigos': 1
|
||||
};
|
||||
|
||||
const CONTROLS = [
|
||||
{ name: 'name', path: 'name', getter: (act) => act.name, random: async act => await RdDNameGen.generate() },
|
||||
{ name: 'sexe', path: 'system.sexe', getter: act => act.system.sexe, random: async act => await randomFrom(TABLE_SEXES) },
|
||||
{ name: 'age', path: 'system.age', getter: act => act.system.age, random: async act => await RdDDice.rollTotal('(2d4kl)*10 + 1d7xo + 2d20kl') },
|
||||
{ name: 'taille', path: 'system.taille', getter: act => act.system.taille, random: async act => await randomTailleCm(act.system.carac.taille.value) },
|
||||
{ name: 'poids', path: 'system.poids', getter: act => act.system.poids, random: async act => await randomPoidsKg(act.system.carac.taille.value) },
|
||||
{ name: 'main', path: 'system.main', getter: act => act.system.main, random: async act => await randomFrom(TABLE_MAINS) },
|
||||
{ name: 'heure', path: 'system.heure', getter: act => act.system.heure, random: async act => await randomHeure() },
|
||||
{ name: 'cheveux', path: 'system.cheveux', getter: act => act.system.cheveux, random: async act => await randomFrom(TABLE_COULEURS_CHEVEUX) },
|
||||
{ name: 'yeux', path: 'system.yeux', getter: act => act.system.yeux, random: async act => await randomFrom(TABLE_COULEURS_YEUX) },
|
||||
]
|
||||
|
||||
export class AppPersonnageAleatoire extends FormApplication {
|
||||
static preloadHandlebars() {
|
||||
foundry.applications.handlebars.loadTemplates([
|
||||
@@ -47,18 +102,12 @@ export class AppPersonnageAleatoire extends FormApplication {
|
||||
constructor(actor) {
|
||||
super({})
|
||||
this.actor = actor
|
||||
this.current = foundry.utils.duplicate(actor)
|
||||
this.checked = {
|
||||
'name': false,
|
||||
'system.sexe': (this.actor.system.sexe ?? '') == '',
|
||||
'system.age': this.actor.system.age == 0,
|
||||
'system.taille': (this.actor.system.taille ?? '') == '',
|
||||
'system.poids': (this.actor.system.poids ?? '') == '',
|
||||
'system.main': (this.actor.system.main ?? '') == '',
|
||||
'system.heure': (this.actor.system.heure ?? '') == '',
|
||||
'system.cheveux': (this.actor.system.cheveux ?? '') == '',
|
||||
'system.yeux': (this.actor.system.yeux ?? '') == '',
|
||||
}
|
||||
this.current = AppPersonnageAleatoire.getActorValues()
|
||||
this.checked = Object.fromEntries(CONTROLS.map(it => [it.name, [0, '', undefined].includes(it.getter(this.current))]))
|
||||
}
|
||||
|
||||
static getActorValues() {
|
||||
return Object.fromEntries(CONTROLS.map(it => [it.name, it.getter(this.actor)]));
|
||||
}
|
||||
|
||||
async getData(options) {
|
||||
@@ -73,124 +122,84 @@ export class AppPersonnageAleatoire extends FormApplication {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html)
|
||||
this.html = html
|
||||
this.html.find("button.button-cancel").click(async event => await this.close())
|
||||
this.html.find("button.button-apply").click(async event => await this.onApply())
|
||||
this.html.find("input.current-value").change(async event => await this.onChange(event))
|
||||
this.html.find("div.random-field[data-path='system.heure'] select.current-value").change(async event => await this.onChange(event))
|
||||
this.html.find('a[data-action="sexe-masculin"]').click(async event => await this.onSexe('masculin'))
|
||||
this.html.find('a[data-action="sexe-feminin"]').click(async event => await this.onSexe('féminin'))
|
||||
this.html.find("a.random").click(async event => await this.onRandom(event))
|
||||
this.html.find("a.reset").click(async event => await this.onReset(event))
|
||||
this.html.find("a.randomize-selected").click(async event => await this.onRandomizeSelected())
|
||||
this.html.find("input.check-for-random").click(async event => await this.onCheckForRandom(event))
|
||||
|
||||
this.html.find("div.random-field[data-field-name='heure'] select.current-value").change(async event => await this.onChange(event))
|
||||
this.html.find('a[data-action="sexe-masculin"]').click(async event => await this.onSexe('masculin'))
|
||||
this.html.find('a[data-action="sexe-feminin"]').click(async event => await this.onSexe('féminin'))
|
||||
|
||||
this.html.find("button.button-cancel").click(async event => await this.close())
|
||||
this.html.find("button.button-apply").click(async event => await this.onApply())
|
||||
}
|
||||
|
||||
async _updateObject(event, formData) { }
|
||||
|
||||
async onApply() {
|
||||
const updates = Object.fromEntries(
|
||||
PATHS.filter(path => game.user.isGM || path != 'name')
|
||||
.map(path => [path, this.current[path]])
|
||||
CONTROLS.filter(control => game.user.isGM || control.name != 'name')
|
||||
.map(control => [control.path, control.getter(this.current)])
|
||||
)
|
||||
await this.actor.update(updates)
|
||||
await this.close()
|
||||
}
|
||||
|
||||
getPath(selector) {
|
||||
getName(selector) {
|
||||
const fields = this.html.find(selector).parents("div.random-field:first")
|
||||
return fields[0].attributes['data-path'].value
|
||||
return fields[0].attributes['data-field-name'].value
|
||||
}
|
||||
|
||||
getControl(name) {
|
||||
return CONTROLS.find(it => it.name == name) ?? CONTROL_UNKNOWN
|
||||
}
|
||||
|
||||
async onSexe(sexe) {
|
||||
this.current['system.sexe'] = sexe
|
||||
this.current['sexe'] = sexe
|
||||
this.render()
|
||||
}
|
||||
|
||||
async onChange(event) {
|
||||
const path = this.getPath(event.currentTarget)
|
||||
this.current[path] = event.currentTarget.value
|
||||
const name = this.getName(event.currentTarget)
|
||||
const control = this.getControl(name)
|
||||
this.current[control.name] = event.currentTarget.value
|
||||
this.render()
|
||||
}
|
||||
|
||||
|
||||
async onRandom(event) {
|
||||
const path = this.getPath(event.currentTarget)
|
||||
await this.setRandom(path);
|
||||
const name = this.getName(event.currentTarget)
|
||||
const control = this.getControl(name)
|
||||
await this.randomControl(control)
|
||||
this.render()
|
||||
}
|
||||
|
||||
async onReset(event) {
|
||||
const path = this.getPath(event.currentTarget)
|
||||
this.current[path] = this.actor[path]
|
||||
const name = this.getName(event.currentTarget)
|
||||
const control = this.getControl(name)
|
||||
this.current[control.name] = control.getter(this.actor)
|
||||
await this.render()
|
||||
}
|
||||
|
||||
async onCheckForRandom(event) {
|
||||
const path = this.getPath(event.currentTarget)
|
||||
this.checked[path] = event.currentTarget.checked
|
||||
const name = this.getName(event.currentTarget)
|
||||
this.checked[name] = event.currentTarget.checked
|
||||
this.render()
|
||||
}
|
||||
|
||||
async onRandomizeSelected() {
|
||||
const paths = this.html.find("input.check-for-random:checked")
|
||||
const controls = this.html.find("input.check-for-random:checked")
|
||||
.parents("div.random-field")
|
||||
.toArray()
|
||||
.map(it => it.attributes['data-path'].value)
|
||||
await Promise.all(paths.map(path => this.setRandom(path)))
|
||||
.map(it => this.getControl(it.attributes['data-field-name'].value))
|
||||
await Promise.all(controls.map(it => this.randomControl(it)))
|
||||
this.render()
|
||||
}
|
||||
|
||||
async setRandom(path) {
|
||||
this.current[path] = await this.random(path);
|
||||
async randomControl(control) {
|
||||
this.current[control.name] = await control.random(this.current)
|
||||
}
|
||||
|
||||
async random(path) {
|
||||
switch (path) {
|
||||
case 'name':
|
||||
return await RdDNameGen.generate()
|
||||
case 'system.sexe':
|
||||
case 'system.main':
|
||||
case 'system.cheveux':
|
||||
case 'system.yeux':
|
||||
return await this.randomFromMap(RANDOM_VALUES[path])
|
||||
case 'system.poids':
|
||||
return await this.randomPoids()
|
||||
case 'system.taille':
|
||||
return await this.randomTaille()
|
||||
case 'system.age':
|
||||
return await RdDDice.rollTotal('(2d4kl)*10 + 1d7xo + 2d20kl')
|
||||
case 'system.heure':
|
||||
return RdDTimestamp.defHeure(await RdDDice.rollHeure({ rollMode: "selfroll", showDice: SHOW_DICE })).key
|
||||
}
|
||||
return 'unknown'
|
||||
}
|
||||
|
||||
async randomFromMap(valuesMap) {
|
||||
const max = Object.values(valuesMap).reduce(Misc.sum(), 0)
|
||||
const total = await RdDDice.rollTotal(`1d${max}`)
|
||||
let sum = 0
|
||||
for (let entry of Object.entries(valuesMap)) {
|
||||
sum = sum + entry[1]
|
||||
if (sum >= total) {
|
||||
return entry[0]
|
||||
}
|
||||
}
|
||||
return Object.keys(valuesMap)[0]
|
||||
}
|
||||
|
||||
async randomPoids() {
|
||||
const caracTaille = RdDCarac.getCaracDerivee(this.current.system.carac.taille.value)
|
||||
const range = caracTaille.poidsMax - caracTaille.poidsMin + 1
|
||||
const total = await RdDDice.rollTotal(`1d${range} + ${caracTaille.poidsMin}`)
|
||||
return total + ' kg'
|
||||
}
|
||||
|
||||
async randomTaille() {
|
||||
const caracTaille = RdDCarac.getCaracDerivee(this.current.system.carac.taille.value)
|
||||
const base = this.current.system.carac.taille.value * 2 + 60 + caracTaille.poidsMin
|
||||
const variation = Math.floor((caracTaille.poidsMax - caracTaille.poidsMin + base / 5) / 2)
|
||||
const total = await RdDDice.rollTotal(`2d${variation} + ${base}`)
|
||||
const cm = total % 100
|
||||
const dm = cm < 10 ? '0' : ''
|
||||
const m = (total - cm) / 100
|
||||
return `${m}m${dm}${cm}`
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
|
||||
async _createSigneForActor(actor, signe) {
|
||||
await actor.createEmbeddedDocuments("Item", [signe]);
|
||||
await ChatMessage.createChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(actor),
|
||||
content: await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.hbs", {
|
||||
signe: signe,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { RdDInitiative } from "../initiative.mjs";
|
||||
import { MappingCreatureArme } from "./mapping-creature-arme.mjs";
|
||||
import { Misc } from "../misc.js";
|
||||
|
||||
const nomCategorieParade = {
|
||||
const categorie_parade = {
|
||||
"sans-armes": "Sans arme",
|
||||
"armes-naturelles": "Armes naturelles",
|
||||
"hast": "Armes d'hast",
|
||||
@@ -18,6 +18,7 @@ const nomCategorieParade = {
|
||||
"epees-lourdes": "Epées lourdes",
|
||||
"haches": "Haches",
|
||||
"lances": "Lances",
|
||||
"masses": "Masses",
|
||||
}
|
||||
export const ATTAQUE_TYPE = {
|
||||
UNE_MAIN: '(1 main)',
|
||||
@@ -122,7 +123,7 @@ export class RdDItemArme extends RdDItem {
|
||||
/* -------------------------------------------- */
|
||||
static getNomCategorieParade(arme) {
|
||||
const categorie = arme?.system ? RdDItemArme.getCategorieParade(arme) : arme;
|
||||
return nomCategorieParade[categorie];
|
||||
return categorie_parade[categorie];
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
@@ -4,9 +4,8 @@ import { SANS_COMPETENCE } from "../item/base-items.js"
|
||||
import { Misc } from "../misc.js"
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { RdDUtility } from "../rdd-utility.js"
|
||||
import { DIFF } from "../roll/roll-constants.mjs"
|
||||
import { DIFF, ROLL_TYPE_COMP } from "../roll/roll-constants.mjs"
|
||||
import RollDialog from "../roll/roll-dialog.mjs"
|
||||
import { PART_COMP } from "../roll/roll-part-comp.mjs"
|
||||
|
||||
export const MORAL = {
|
||||
MALHEUREUX: "malheureux",
|
||||
@@ -134,7 +133,7 @@ export class Apprecier {
|
||||
const competence = (this.appreciation.jetComp && this.appreciation.competence) ? this.appreciation.competence : ""
|
||||
const rollData = {
|
||||
ids: { actorId: this.actor.id },
|
||||
type: { allowed: [PART_COMP], current: PART_COMP, appreciation: true },
|
||||
type: { allowed: [ROLL_TYPE_COMP], current: ROLL_TYPE_COMP, appreciation: true },
|
||||
selected: {
|
||||
carac: { key: this.appreciation.carac, forced: true },
|
||||
comp: { key: competence, forced: true },
|
||||
|
||||
@@ -3,38 +3,38 @@ import { Misc } from "./misc.js";
|
||||
|
||||
const TABLE_CARACTERISTIQUES_DERIVEES = {
|
||||
// xp: coût pour passer du niveau inférieur à ce niveau
|
||||
1: { xp: 3, niveau: -5, poids: "moins de 1kg", poidsMin: 0, poidsMax: 1, plusdom: -5, sconst: 0.5, sust: 0.1 },
|
||||
2: { xp: 3, niveau: -4, poids: "1-5", poidsMin: 1, poidsMax: 5, plusdom: -4, sconst: 0.5, sust: 0.3 },
|
||||
3: { xp: 4, niveau: -3, poids: "6-10", poidsMin: 6, poidsMax: 10, plusdom: -3, sconst: 1, sust: 0.5, beaute: 'hideux' },
|
||||
4: { xp: 4, niveau: -2, poids: "11-20", poidsMin: 11, poidsMax: 20, plusdom: -3, sconst: 1, sust: 1, beaute: 'repoussant' },
|
||||
5: { xp: 5, niveau: -1, poids: "21-30", poidsMin: 21, poidsMax: 30, plusdom: -2, sconst: 1, sust: 1, beaute: 'franchement très laid' },
|
||||
6: { xp: 5, niveau: 0, poids: "31-40", poidsMin: 31, poidsMax: 40, plusdom: -1, sconst: 2, sust: 2, beaute: 'laid' },
|
||||
7: { xp: 6, niveau: 0, poids: "41-50", poidsMin: 41, poidsMax: 50, plusdom: -1, sconst: 2, sust: 2, beaute: 'très désavantagé' },
|
||||
8: { xp: 6, niveau: 0, poids: "51-60", poidsMin: 51, poidsMax: 60, plusdom: 0, sconst: 2, sust: 2, beaute: 'désavantagé' },
|
||||
9: { xp: 7, niveau: 0, poids: "61-65", poidsMin: 61, poidsMax: 65, plusdom: 0, sconst: 3, sust: 2, beaute: 'pas terrible' },
|
||||
10: { xp: 7, niveau: 0, poids: "66-70", poidsMin: 66, poidsMax: 70, plusdom: 0, sconst: 3, sust: 3, beaute: 'commun' },
|
||||
11: { xp: 8, niveau: 1, poids: "71-75", poidsMin: 71, poidsMax: 75, plusdom: 0, sconst: 3, sust: 3, beaute: 'pas mal' },
|
||||
12: { xp: 8, niveau: 1, poids: "76-80", poidsMin: 76, poidsMax: 80, plusdom: +1, sconst: 4, sust: 3, beaute: 'avantagé' },
|
||||
13: { xp: 9, niveau: 2, poids: "81-90", poidsMin: 81, poidsMax: 90, plusdom: +1, sconst: 4, sust: 3, beaute: 'mignon' },
|
||||
14: { xp: 9, niveau: 2, poids: "91-100", poidsMin: 91, poidsMax: 100, plusdom: +2, sconst: 4, sust: 4, beaute: 'beau' },
|
||||
15: { xp: 10, niveau: 3, poids: "101-110", poidsMin: 101, poidsMax: 110, plusdom: +2, sconst: 5, sust: 4, beaute: 'très beau' },
|
||||
16: { xp: 20, niveau: 3, poids: "111-120", poidsMin: 111, poidsMax: 120, plusdom: +3, sconst: 5, sust: 4, beaute: 'éblouissant' },
|
||||
17: { xp: 30, niveau: 4, poids: "121-131", poidsMin: 121, poidsMax: 131, plusdom: +3, sconst: 5, sust: 5 },
|
||||
18: { xp: 40, niveau: 4, poids: "131-141", poidsMin: 131, poidsMax: 141, plusdom: +4, sconst: 6, sust: 5 },
|
||||
19: { xp: 50, niveau: 5, poids: "141-150", poidsMin: 141, poidsMax: 150, plusdom: +4, sconst: 6, sust: 5 },
|
||||
20: { xp: 60, niveau: 5, poids: "151-160", poidsMin: 151, poidsMax: 160, plusdom: +4, sconst: 6, sust: 6 },
|
||||
21: { xp: 70, niveau: 6, poids: "161-180", poidsMin: 161, poidsMax: 180, plusdom: +5, sconst: 7, sust: 6 },
|
||||
22: { xp: 80, niveau: 6, poids: "181-200", poidsMin: 181, poidsMax: 200, plusdom: +5, sconst: 7, sust: 7 },
|
||||
23: { xp: 90, niveau: 7, poids: "201-300", poidsMin: 201, poidsMax: 300, plusdom: +6, sconst: 7, sust: 8 },
|
||||
24: { xp: 100, niveau: 7, poids: "301-400", poidsMin: 301, poidsMax: 400, plusdom: +6, sconst: 8, sust: 9 },
|
||||
25: { xp: 110, niveau: 8, poids: "401-500", poidsMin: 401, poidsMax: 500, plusdom: +7, sconst: 8, sust: 10 },
|
||||
26: { xp: 120, niveau: 8, poids: "501-600", poidsMin: 501, poidsMax: 600, plusdom: +7, sconst: 8, sust: 11 },
|
||||
27: { xp: 130, niveau: 9, poids: "601-700", poidsMin: 601, poidsMax: 700, plusdom: +8, sconst: 9, sust: 12 },
|
||||
28: { xp: 140, niveau: 9, poids: "701-800", poidsMin: 701, poidsMax: 800, plusdom: +8, sconst: 9, sust: 13 },
|
||||
29: { xp: 150, niveau: 10, poids: "801-900", poidsMin: 801, poidsMax: 900, plusdom: +9, sconst: 9, sust: 14 },
|
||||
30: { xp: 160, niveau: 10, poids: "901-1000", poidsMin: 901, poidsMax: 1000, plusdom: +9, sconst: 10, sust: 15 },
|
||||
31: { xp: 170, niveau: 11, poids: "1001-1500", poidsMin: 1001, poidsMax: 1500, plusdom: +10, sconst: 10, sust: 16 },
|
||||
32: { xp: 180, niveau: 11, poids: "1501-2000", poidsMin: 1501, poidsMax: 2000, plusdom: +11, sconst: 10, sust: 17 }
|
||||
1: { xp: 3, niveau: -5, taille: 40, poids: "moins de 1kg", poidsMin: 0, poidsMax: 1, plusdom: -5, sconst: 0.5, sust: 0.1 },
|
||||
2: { xp: 3, niveau: -4, taille: 70, poids: "1-5", poidsMin: 1, poidsMax: 5, plusdom: -4, sconst: 0.5, sust: 0.3 },
|
||||
3: { xp: 4, niveau: -3, taille: 100, poids: "6-10", poidsMin: 6, poidsMax: 10, plusdom: -3, sconst: 1, sust: 0.5, beaute: 'hideux' },
|
||||
4: { xp: 4, niveau: -2, taille: 120, poids: "11-20", poidsMin: 11, poidsMax: 20, plusdom: -3, sconst: 1, sust: 1, beaute: 'repoussant' },
|
||||
5: { xp: 5, niveau: -1, taille: 135, poids: "21-30", poidsMin: 21, poidsMax: 30, plusdom: -2, sconst: 1, sust: 1, beaute: 'franchement très laid' },
|
||||
6: { xp: 5, niveau: 0, taille: 145, poids: "31-40", poidsMin: 31, poidsMax: 40, plusdom: -1, sconst: 2, sust: 2, beaute: 'laid' },
|
||||
7: { xp: 6, niveau: 0, taille: 150, poids: "41-50", poidsMin: 41, poidsMax: 50, plusdom: -1, sconst: 2, sust: 2, beaute: 'très désavantagé' },
|
||||
8: { xp: 6, niveau: 0, taille: 155, poids: "51-60", poidsMin: 51, poidsMax: 60, plusdom: 0, sconst: 2, sust: 2, beaute: 'désavantagé' },
|
||||
9: { xp: 7, niveau: 0, taille: 160, poids: "61-65", poidsMin: 61, poidsMax: 65, plusdom: 0, sconst: 3, sust: 2, beaute: 'pas terrible' },
|
||||
10: { xp: 7, niveau: 0, taille: 170, poids: "66-70", poidsMin: 66, poidsMax: 70, plusdom: 0, sconst: 3, sust: 3, beaute: 'commun' },
|
||||
11: { xp: 8, niveau: 1, taille: 175, poids: "71-75", poidsMin: 71, poidsMax: 75, plusdom: 0, sconst: 3, sust: 3, beaute: 'pas mal' },
|
||||
12: { xp: 8, niveau: 1, taille: 180, poids: "76-80", poidsMin: 76, poidsMax: 80, plusdom: +1, sconst: 4, sust: 3, beaute: 'avantagé' },
|
||||
13: { xp: 9, niveau: 2, taille: 185, poids: "81-90", poidsMin: 81, poidsMax: 90, plusdom: +1, sconst: 4, sust: 3, beaute: 'mignon' },
|
||||
14: { xp: 9, niveau: 2, taille: 190, poids: "91-100", poidsMin: 91, poidsMax: 100, plusdom: +2, sconst: 4, sust: 4, beaute: 'beau' },
|
||||
15: { xp: 10, niveau: 3, taille: 200, poids: "101-110", poidsMin: 101, poidsMax: 110, plusdom: +2, sconst: 5, sust: 4, beaute: 'très beau' },
|
||||
16: { xp: 20, niveau: 3, taille: 210, poids: "111-120", poidsMin: 111, poidsMax: 120, plusdom: +3, sconst: 5, sust: 4, beaute: 'éblouissant' },
|
||||
17: { xp: 30, niveau: 4, taille: 220, poids: "121-131", poidsMin: 121, poidsMax: 131, plusdom: +3, sconst: 5, sust: 5 },
|
||||
18: { xp: 40, niveau: 4, taille: 230, poids: "131-141", poidsMin: 131, poidsMax: 141, plusdom: +4, sconst: 6, sust: 5 },
|
||||
19: { xp: 50, niveau: 5, taille: 240, poids: "141-150", poidsMin: 141, poidsMax: 150, plusdom: +4, sconst: 6, sust: 5 },
|
||||
20: { xp: 60, niveau: 5, taille: 250, poids: "151-160", poidsMin: 151, poidsMax: 160, plusdom: +4, sconst: 6, sust: 6 },
|
||||
21: { xp: 70, niveau: 6, taille: 260, poids: "161-180", poidsMin: 161, poidsMax: 180, plusdom: +5, sconst: 7, sust: 6 },
|
||||
22: { xp: 80, niveau: 6, taille: 270, poids: "181-200", poidsMin: 181, poidsMax: 200, plusdom: +5, sconst: 7, sust: 7 },
|
||||
23: { xp: 90, niveau: 7, taille: 280, poids: "201-300", poidsMin: 201, poidsMax: 300, plusdom: +6, sconst: 7, sust: 8 },
|
||||
24: { xp: 100, niveau: 7, taille: 290, poids: "301-400", poidsMin: 301, poidsMax: 400, plusdom: +6, sconst: 8, sust: 9 },
|
||||
25: { xp: 110, niveau: 8, taille: 300, poids: "401-500", poidsMin: 401, poidsMax: 500, plusdom: +7, sconst: 8, sust: 10 },
|
||||
26: { xp: 120, niveau: 8, taille: 310, poids: "501-600", poidsMin: 501, poidsMax: 600, plusdom: +7, sconst: 8, sust: 11 },
|
||||
27: { xp: 130, niveau: 9, taille: 320, poids: "601-700", poidsMin: 601, poidsMax: 700, plusdom: +8, sconst: 9, sust: 12 },
|
||||
28: { xp: 140, niveau: 9, taille: 330, poids: "701-800", poidsMin: 701, poidsMax: 800, plusdom: +8, sconst: 9, sust: 13 },
|
||||
29: { xp: 150, niveau: 10, taille: 340, poids: "801-900", poidsMin: 801, poidsMax: 900, plusdom: +9, sconst: 9, sust: 14 },
|
||||
30: { xp: 160, niveau: 10, taille: 350, poids: "901-1000", poidsMin: 901, poidsMax: 1000, plusdom: +9, sconst: 10, sust: 15 },
|
||||
31: { xp: 170, niveau: 11, taille: 360, poids: "1001-1500", poidsMin: 1001, poidsMax: 1500, plusdom: +10, sconst: 10, sust: 16 },
|
||||
32: { xp: 180, niveau: 11, taille: 370, poids: "1501-2000", poidsMin: 1501, poidsMax: 2000, plusdom: +11, sconst: 10, sust: 17 },
|
||||
};
|
||||
|
||||
export const CARACS = {
|
||||
|
||||
@@ -170,7 +170,7 @@ export class RdDCombatManager extends Combat {
|
||||
}
|
||||
|
||||
static getFirstInitRollFormula(actor) {
|
||||
const actions = actor.listActions({ isEquipe: true })
|
||||
const actions = actor.listActions()
|
||||
if (actions.length > 0) {
|
||||
const action = actions[0]
|
||||
const init = RdDCombatManager.getInitData(actor, action)
|
||||
@@ -307,7 +307,7 @@ export class RdDCombatManager extends Combat {
|
||||
const possessions = actor.listActionsPossessions()
|
||||
const actions = possessions.length > 0
|
||||
? possessions
|
||||
: actor.listActions({ isEquipe: true })
|
||||
: actor.listActions()
|
||||
|
||||
return Misc.indexed(actions)
|
||||
}
|
||||
@@ -644,7 +644,7 @@ export class RdDCombat {
|
||||
opponentId: this.defender.id,
|
||||
opponentTokenId: this.defenderTokenId,
|
||||
},
|
||||
type: { allowed: ['attaque'], current: 'attaque' },
|
||||
type: { allowed: [ROLL_TYPE_ATTAQUE], current: ROLL_TYPE_ATTAQUE },
|
||||
selected: {},
|
||||
passeArme: foundry.utils.randomID(16),
|
||||
}
|
||||
|
||||
@@ -218,9 +218,6 @@ export class RdDCommands {
|
||||
/* -------------------------------------------- */
|
||||
/* Manage chat commands */
|
||||
processChatCommand(commandLine, content = '', msg = {}) {
|
||||
// Setup new message's visibility
|
||||
ChatUtility.applyRollMode(msg)
|
||||
msg.type = 0;
|
||||
|
||||
if (!this.commandsTable) {
|
||||
this._registerCommands()
|
||||
@@ -228,6 +225,9 @@ export class RdDCommands {
|
||||
|
||||
let command = commandLine[0].toLowerCase();
|
||||
if (this._isCommandHandled(command)) {
|
||||
// Setup new message's visibility
|
||||
ChatUtility.applyRollMode(msg)
|
||||
msg.type = 0;
|
||||
let params = commandLine.slice(1);
|
||||
this._processCommand(this.commandsTable, command, params, content, msg)
|
||||
return true
|
||||
@@ -466,7 +466,10 @@ export class RdDCommands {
|
||||
|
||||
async supprimerSignesDraconiquesEphemeres() {
|
||||
if (game.user.isGM) {
|
||||
game.actors.forEach(actor => actor.supprimerSignesDraconiques(it => it.system.ephemere))
|
||||
await Promise.all(
|
||||
game.actors.filter(actor => actor.isHautRevant())
|
||||
.map(actor => actor.supprimerSignesDraconiques(it => it.system.ephemere))
|
||||
)
|
||||
}
|
||||
else {
|
||||
ui.notifications.warn("Seul le MJ est autorisé à utiliser la commande /signe");
|
||||
|
||||
@@ -18,7 +18,7 @@ export class DeTMR extends foundry.dice.terms.Die {
|
||||
|
||||
static diceSoNiceData(system) {
|
||||
return {
|
||||
type: "dt",
|
||||
type: "d8",
|
||||
font: "HeuresDraconiques",
|
||||
fontScale: 0.8,
|
||||
labels: ['1', '2', '3', '4', '5', '6', 'd', '0'],
|
||||
@@ -56,7 +56,7 @@ export class DeDraconique extends foundry.dice.terms.Die {
|
||||
|
||||
static diceSoNiceData(system) {
|
||||
return {
|
||||
type: "dr",
|
||||
type: "d8",
|
||||
font: "HeuresDraconiques",
|
||||
fontScale: 0.8,
|
||||
labels: ['1', '2', '3', '4', '5', '6', 'd', '0'],
|
||||
@@ -96,7 +96,7 @@ export class DeHeure extends foundry.dice.terms.Die {
|
||||
|
||||
static diceSoNiceData(system) {
|
||||
return {
|
||||
type: "dh",
|
||||
type: "d12",
|
||||
font: "HeuresDraconiques",
|
||||
fontScale: 1.2,
|
||||
labels: ['v', 'i', 'f', 'o', 'd', 'e', 'l', 's', 'p', 'a', 'r', 'c'],
|
||||
|
||||
@@ -377,7 +377,17 @@ export class SystemReveDeDragon {
|
||||
/* -------------------------------------------- */
|
||||
game.system.rdd.calendrier = new RdDCalendrier()
|
||||
if (Misc.isFirstConnectedGM()) {
|
||||
new Migrations().migrate()
|
||||
try {
|
||||
new Migrations().migrate()
|
||||
}
|
||||
catch (erreur) {
|
||||
const message = `<p>Erreur lors de la migration du système Rêve de Dragon: ${erreur}</p><p>Plus de détails sont sans doute disponibles dans la console de Foundry/du navigateur.</p><p>Merci de nous signaler cetter erreur qu'on puisse ous aider et réparer le problème.</p>`
|
||||
ui.notifications.error(message)
|
||||
await ChatMessage.create({
|
||||
user: game.user.id,
|
||||
content: message
|
||||
})
|
||||
}
|
||||
this.messageDeBienvenue()
|
||||
import("https://www.uberwald.me/fvtt_appcount/count-class-ready.js").then(moduleCounter => {
|
||||
console.log("ClassCounter loaded", moduleCounter)
|
||||
@@ -399,7 +409,7 @@ export class SystemReveDeDragon {
|
||||
if (!game.user.isGM && game.user.character == undefined) {
|
||||
ui.notifications.info("Attention ! Vous n'êtes connecté à aucun personnage !")
|
||||
ChatMessage.create({
|
||||
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est connecté à aucun personnage !",
|
||||
content: `<b>ATTENTION</b> Le joueur ${game.user.name} n'est connecté à aucun personnage !`,
|
||||
user: game.user.id
|
||||
})
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export class RdDTokenHud {
|
||||
|
||||
static async addExtensionHudCombatV2(html, combatant, actor, token) {
|
||||
const isPossession = actor.listActionsPossessions().length > 0;
|
||||
const actionsCombat = isPossession ? [] : actor.listAttaques()
|
||||
const actionsCombat = isPossession ? [] : actor.listActions()
|
||||
const ajustements = combatant?.initiative ?
|
||||
[
|
||||
{ label: 'Initiative +1', action: 'delta', value: 1 },
|
||||
|
||||
@@ -47,8 +47,10 @@ export default class ChatRollResult {
|
||||
{
|
||||
content: await this.buildRollHtml(roll)
|
||||
},
|
||||
roll.active.actor,
|
||||
roll.current?.rollmode?.key
|
||||
{
|
||||
actor: roll.active.actor,
|
||||
rollMode: roll.current?.rollmode?.key
|
||||
}
|
||||
))
|
||||
|
||||
await this.saveChatMessageRoll(chatMessage, roll, impacts)
|
||||
@@ -200,6 +202,7 @@ export default class ChatRollResult {
|
||||
const chatMessage = ChatUtility.getChatMessage(event)
|
||||
const savedRoll = this.loadChatMessageRoll(chatMessage)
|
||||
const actor = this.getActiveActor(savedRoll)
|
||||
|
||||
Misc.doIfOwner(actor, it => it.rollAppelChance(
|
||||
() => this.onAppelChanceSuccess(savedRoll, chatMessage),
|
||||
() => this.onAppelChanceEchec(savedRoll, chatMessage))
|
||||
@@ -208,6 +211,7 @@ export default class ChatRollResult {
|
||||
|
||||
async onAppelChanceSuccess(roll, chatMessage) {
|
||||
roll.type.retry = true
|
||||
roll.type.appelChance = true
|
||||
await this.updateChatMessage(chatMessage, roll)
|
||||
|
||||
const callbacks = [ChatUtility.remover(chatMessage)]
|
||||
|
||||
@@ -9,6 +9,8 @@ export const ROLL_TYPE_MEDITATION = 'meditation'
|
||||
export const ROLL_TYPE_OEUVRE = 'oeuvre'
|
||||
export const ROLL_TYPE_SORT = 'sort'
|
||||
export const ROLL_TYPE_TACHE = 'tache'
|
||||
export const ROLL_TYPE_APPEL_CHANCE = 'appel-chance'
|
||||
export const ROLL_TYPE_REVE_RESISTANCE = 'reve-resistance'
|
||||
|
||||
export const ATTAQUE_ROLL_TYPES = [ROLL_TYPE_ATTAQUE]
|
||||
export const COMBAT_ROLL_TYPES = [ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE]
|
||||
@@ -33,3 +35,10 @@ export const DIFFS = {
|
||||
[DIFF.AUCUN]: { key: DIFF.AUCUN, label: "", libre: false, visible: false, max: 0 },
|
||||
}
|
||||
|
||||
export class RollConstants {
|
||||
static findCompetence(rollData, name) {
|
||||
return rollData.active.actor.getCompetence(name, { onMessage: message => { } })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ import { RollPartResistance } from "./roll-part-resistance.mjs";
|
||||
import { RollTypePossession } from "./roll-type-possession.mjs";
|
||||
import { RollPartPossession } from "./roll-part-possession.mjs";
|
||||
import { RollPartApprecier } from "./roll-part-apprecier.mjs";
|
||||
import { RollTypeAppelChance } from "./roll-type-appel-chance.mjs";
|
||||
import { RollTypeReveResistance } from "./roll-type-resistance.mjs";
|
||||
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api
|
||||
@@ -65,7 +67,8 @@ export const ALL_ROLL_TYPES = [
|
||||
new RollTypeCuisine(),
|
||||
new RollTypeOeuvre(),
|
||||
new RollTypeJeu(),
|
||||
// new RollTypeResistance ??
|
||||
new RollTypeAppelChance(),
|
||||
new RollTypeReveResistance(),
|
||||
// new RollTypeFixedCarac ??
|
||||
]
|
||||
|
||||
@@ -290,7 +293,6 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
return rollData.type?.allowed
|
||||
? ROLL_PARTS.filter(p => RollDialog.$isIntersecting(rollData.type.allowed, p.rollTypes))
|
||||
: ROLL_PARTS
|
||||
|
||||
}
|
||||
|
||||
/** pre-configure les paramètres des différentes parties de la fenêtre (par exemple, prépare les listes de caractéristiques/compétences */
|
||||
|
||||
@@ -35,7 +35,8 @@ export class RollPartAttaque extends RollPartSelect {
|
||||
|
||||
loadRefs(rollData) {
|
||||
const refs = this.getRefs(rollData)
|
||||
const attaques = rollData.active.actor.listAttaques()
|
||||
const attaques = rollData.active.actor.listActions()
|
||||
.filter(it => !it.initOnly)
|
||||
.sort(Misc.descending(it => it.comp?.system.niveau ?? -8))
|
||||
refs.all = attaques.map(it => RollPartAttaque.$extractAttaque(it, rollData))
|
||||
this.filterAttaquesInitiative(rollData)
|
||||
@@ -186,7 +187,9 @@ export class RollPartAttaque extends RollPartSelect {
|
||||
part.setDiff(rollData, { type: DIFF.DEFAUT })
|
||||
}
|
||||
else {
|
||||
part.setDiff(rollData, { type: DIFF.ATTAQUE, diff: current.initialDiff })
|
||||
if (!rollData.type.appelChance){
|
||||
part.setDiff(rollData, { type: DIFF.ATTAQUE, diff: current.initialDiff })
|
||||
}
|
||||
current.initialDiff = undefined
|
||||
}
|
||||
break
|
||||
|
||||
@@ -27,7 +27,7 @@ export class RollPartComp extends RollPartSelect {
|
||||
const selected = this.getSelected(rollData)
|
||||
const all = this.$getActorComps(rollData)
|
||||
const selectedComp = selected.key
|
||||
if (selected.forced && selectedComp) {
|
||||
if (selected.forced && selectedComp!= undefined ) {
|
||||
refs.all = all.filter(comp => Grammar.equalsInsensitive(comp.label, selectedComp))
|
||||
if (refs.all.length == 0) {
|
||||
if (selected.key && selected.key.length > 0) {
|
||||
@@ -47,8 +47,11 @@ export class RollPartComp extends RollPartSelect {
|
||||
const current = this.getCurrent(rollData)
|
||||
const selectedCarac = RollPart.getSelectedPart(rollData, PART_CARAC)
|
||||
const selectedDiff = RollPart.getSelectedPart(rollData, PART_DIFF)
|
||||
this.rollPartCarac.selectByKey(rollData, selectedCarac?.key ?? current.comp.system.defaut_carac)
|
||||
this.rollPartDiff.setDiff(rollData, selectedDiff?.value ?? current.comp.system.default_diffLibre)
|
||||
if (!rollData.type.appelChance){
|
||||
this.rollPartCarac.selectByKey(rollData, selectedCarac?.key ?? current.comp.system.defaut_carac)
|
||||
this.rollPartDiff.setDiff(rollData, selectedDiff?.value ?? current.comp.system.default_diffLibre)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ export class RollPartConditions extends RollPart {
|
||||
settingMin() { return RollPart.settingKey(this, 'min') }
|
||||
settingMax() { return RollPart.settingKey(this, 'max') }
|
||||
|
||||
visible(rollData) {
|
||||
const current = this.getCurrent(rollData)
|
||||
return !current.hide
|
||||
}
|
||||
|
||||
onReady(rollParts) {
|
||||
game.settings.register(SYSTEM_RDD, this.settingMin(),
|
||||
{
|
||||
@@ -36,6 +41,7 @@ export class RollPartConditions extends RollPart {
|
||||
restore(rollData) {
|
||||
const current = this.getCurrent(rollData)
|
||||
current.value = this.getSaved(rollData)?.value ?? current.value ?? 0
|
||||
current.hide = this.getSaved(rollData)?.hide
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ITEM_TYPES } from "../constants.js"
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { ROLL_TYPE_CUISINE } from "./roll-constants.mjs"
|
||||
import { ROLL_TYPE_CUISINE, RollConstants } from "./roll-constants.mjs"
|
||||
import { PART_CARAC } from "./roll-part-carac.mjs"
|
||||
import { PART_COMP } from "./roll-part-comp.mjs"
|
||||
import { RollPartSelect } from "./roll-part-select.mjs"
|
||||
@@ -18,7 +18,11 @@ export class RollPartCuisine extends RollPartSelect {
|
||||
|
||||
get rollTypes() { return [ROLL_TYPE_CUISINE] }
|
||||
|
||||
isValid(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
isValid(rollData) {
|
||||
return rollData.active.actor.isPersonnage()
|
||||
&& RollConstants.findCompetence(rollData, 'Cuisine')
|
||||
}
|
||||
|
||||
visible(rollData) { return RollPart.isRollType(rollData, ROLL_TYPE_CUISINE) }
|
||||
|
||||
restore(rollData) {
|
||||
@@ -38,14 +42,18 @@ export class RollPartCuisine extends RollPartSelect {
|
||||
|
||||
loadRefs(rollData) {
|
||||
const refs = this.getRefs(rollData)
|
||||
const actor = rollData.active.actor
|
||||
refs.cuisine = actor.getCompetence('Cuisine')
|
||||
refs.cuisine = RollConstants.findCompetence(rollData, 'Cuisine')
|
||||
|
||||
const recettes = actor.items
|
||||
if (!refs.cuisine) {
|
||||
refs.preparations = []
|
||||
return
|
||||
}
|
||||
|
||||
const recettes = rollData.active.actor.items
|
||||
.filter(it => it.type == ITEM_TYPES.recettecuisine)
|
||||
.map(it => RollPartCuisine.$extractPreparationRecette(refs.cuisine, it))
|
||||
|
||||
const ingredientsBruts = actor.items
|
||||
const ingredientsBruts = rollData.active.actor.items
|
||||
.filter(it => it.getUtilisationCuisine() == 'brut')
|
||||
.map(it => RollPartCuisine.$extractPreparationBrut(refs.cuisine, it))
|
||||
|
||||
|
||||
@@ -131,7 +131,11 @@ export class RollPartDefense extends RollPartSelect {
|
||||
switch (part.code) {
|
||||
case PART_CARAC: return part.filterCaracs(rollData, refs.defenses.length > 0 ? [current.carac] : ['impossible'])
|
||||
case PART_COMP: return part.filterComps(rollData, refs.defenses.length > 0 ? [current.comp?.name] : ['impossible'])
|
||||
case PART_DIFF: return part.setDiff(rollData, this.getDiffDefense(rollData))
|
||||
case PART_DIFF:
|
||||
if (!rollData.type.appelChance) {
|
||||
return part.setDiff(rollData, this.getDiffDefense(rollData))
|
||||
}
|
||||
return
|
||||
case PART_SIGN: return part.setArme(rollData, this.getArmeDisparate(rollData), current.forceRequise)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export class RollPartDiff extends RollPart {
|
||||
}
|
||||
const current = this.getCurrent(rollData)
|
||||
/* TODO: affiner les cas où afficher ou non. devrait s'afficher pour les jets basiques (même si pas d'opposant sélectionné)*/
|
||||
return Object.values(DIFF).includes(current.type)
|
||||
return (DIFF.AUCUN !=current.type) && Object.values(DIFF).includes(current.type)
|
||||
}
|
||||
|
||||
prepareContext(rollData) {
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { ITEM_TYPES } from "../constants.js"
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { ROLL_TYPE_JEU } from "./roll-constants.mjs"
|
||||
import { ROLL_TYPE_JEU, RollConstants } from "./roll-constants.mjs"
|
||||
import { PART_CARAC } from "./roll-part-carac.mjs"
|
||||
import { PART_COMP, RollPartComp } from "./roll-part-comp.mjs"
|
||||
import { RollPartSelect } from "./roll-part-select.mjs"
|
||||
import { ROLLDIALOG_SECTION, RollPart } from "./roll-part.mjs"
|
||||
import { RdDItem } from "../item.js"
|
||||
import { Misc } from "../misc.js"
|
||||
import { Grammar } from "../grammar.js"
|
||||
|
||||
export const PART_JEU = "jeu"
|
||||
|
||||
@@ -19,15 +18,21 @@ export class RollPartJeu extends RollPartSelect {
|
||||
get section() { return ROLLDIALOG_SECTION.CHOIX }
|
||||
|
||||
get rollTypes() { return [ROLL_TYPE_JEU] }
|
||||
isValid(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
isValid(rollData) {
|
||||
return rollData.active.actor.isPersonnage()
|
||||
&& RollConstants.findCompetence(rollData, 'Jeu')
|
||||
}
|
||||
|
||||
visible(rollData) { return RollPart.isRollType(rollData, ROLL_TYPE_JEU) }
|
||||
|
||||
loadRefs(rollData) {
|
||||
const refs = this.getRefs(rollData)
|
||||
const actor = rollData.active.actor
|
||||
const compJeu = actor.getCompetence(COMPETENCE_JEU)
|
||||
|
||||
refs.jeux = actor.itemTypes[ITEM_TYPES.jeu]
|
||||
const compJeu = RollConstants.findCompetence(rollData, 'Jeu')
|
||||
if (!compJeu) {
|
||||
refs.jeux = []
|
||||
return
|
||||
}
|
||||
refs.jeux = rollData.active.actor.itemTypes[ITEM_TYPES.jeu]
|
||||
.map(it => RollPartJeu.$extractJeu(it, compJeu))
|
||||
|
||||
if (refs.jeux.length > 0) {
|
||||
@@ -51,22 +56,22 @@ export class RollPartJeu extends RollPartSelect {
|
||||
}
|
||||
}
|
||||
|
||||
static $getJeuBase(jeu, comp, caracs) {
|
||||
if (jeu.system.base < comp.system.niveau) {
|
||||
static $getJeuBase(jeu, compJeu, caracs) {
|
||||
if (jeu.system.base < compJeu.system.niveau) {
|
||||
return undefined
|
||||
}
|
||||
return new RdDItem({
|
||||
id: comp.id,
|
||||
id: compJeu.id,
|
||||
name: `Jeu ${Misc.lowerFirst(jeu.name)}`,
|
||||
type: ITEM_TYPES.competence,
|
||||
img: comp.img,
|
||||
img: compJeu.img,
|
||||
system: foundry.utils.mergeObject(
|
||||
{
|
||||
niveau: jeu.system.base,
|
||||
base: jeu.system.base,
|
||||
default_carac: caracs.length > 0 ? caracs[0] : CARACS.CHANCE
|
||||
},
|
||||
comp.system,
|
||||
compJeu.system,
|
||||
{ overwrite: false }
|
||||
)
|
||||
})
|
||||
@@ -90,7 +95,7 @@ export class RollPartJeu extends RollPartSelect {
|
||||
|
||||
static forceCompJeu(rollData) {
|
||||
const jeu = rollData.current[PART_JEU].base ?? rollData.current[PART_JEU].comp
|
||||
if (jeu){
|
||||
if (jeu) {
|
||||
rollData.refs[PART_COMP].comps = [jeu].map(it => RollPartComp.extractComp(it))
|
||||
}
|
||||
else {
|
||||
|
||||
31
module/roll/roll-type-appel-chance.mjs
Normal file
31
module/roll/roll-type-appel-chance.mjs
Normal file
@@ -0,0 +1,31 @@
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { DIFF, ROLL_TYPE_APPEL_CHANCE } from "./roll-constants.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
|
||||
export class RollTypeAppelChance extends RollType {
|
||||
get code() { return ROLL_TYPE_APPEL_CHANCE }
|
||||
get name() { return `fait appel à la chance` }
|
||||
get icon() { return `systems/foundryvtt-reve-de-dragon/assets/ui/chance.svg` }
|
||||
get chatResultTemplate() { return `systems/foundryvtt-reve-de-dragon/templates/roll/result/chat-appel-chance.hbs` }
|
||||
|
||||
title(rollData) {
|
||||
return this.name
|
||||
}
|
||||
|
||||
setRollDataType(rollData) {
|
||||
foundry.utils.mergeObject(rollData, {
|
||||
selected: {
|
||||
carac: { key: CARACS.CHANCE_ACTUELLE, forced: true },
|
||||
diff: { value: 0, type: '' },
|
||||
comp: { key: '', forced: true },
|
||||
conditions: { hide: true }
|
||||
}
|
||||
})
|
||||
super.setRollDataType(rollData)
|
||||
}
|
||||
|
||||
onSelect(rollData) {
|
||||
this.setDiffType(rollData, DIFF.AUCUN)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ITEM_TYPES } from "../constants.js"
|
||||
import { APPRECIATION } from "../moral/apprecier.mjs"
|
||||
import { RollBasicParts } from "./roll-basic-parts.mjs"
|
||||
import { DIFF, ROLL_TYPE_CUISINE } from "./roll-constants.mjs"
|
||||
import { DIFF, ROLL_TYPE_CUISINE, RollConstants } from "./roll-constants.mjs"
|
||||
import { PART_CUISINE } from "./roll-part-cuisine.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
|
||||
@@ -9,7 +9,11 @@ export class RollTypeCuisine extends RollType {
|
||||
get code() { return ROLL_TYPE_CUISINE }
|
||||
get name() { return `Cuisiner un plat` }
|
||||
|
||||
visible(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
visible(rollData) {
|
||||
return rollData.active.actor.isPersonnage()
|
||||
&& RollConstants.findCompetence(rollData, 'Cuisine')
|
||||
}
|
||||
|
||||
title(rollData) {
|
||||
const current = rollData.current[PART_CUISINE]
|
||||
return current.recette ? `prépare une recette: ${current.label}` : `prépare: ${current.label}`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PART_JEU, RollPartJeu } from "./roll-part-jeu.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
import { DIFF, ROLL_TYPE_JEU } from "./roll-constants.mjs"
|
||||
import { DIFF, ROLL_TYPE_JEU, RollConstants } from "./roll-constants.mjs"
|
||||
import { Apprecier } from "../moral/apprecier.mjs"
|
||||
|
||||
|
||||
@@ -8,7 +8,11 @@ export class RollTypeJeu extends RollType {
|
||||
get code() { return ROLL_TYPE_JEU }
|
||||
get name() { return `Jouer` }
|
||||
|
||||
visible(rollData) { return rollData.active.actor.isPersonnage() }
|
||||
visible(rollData) {
|
||||
return rollData.active.actor.isPersonnage()
|
||||
&& RollConstants.findCompetence(rollData, 'Jeu')
|
||||
}
|
||||
|
||||
title(rollData) {
|
||||
if (rollData.opponent) {
|
||||
return `joue contre`
|
||||
|
||||
31
module/roll/roll-type-resistance.mjs
Normal file
31
module/roll/roll-type-resistance.mjs
Normal file
@@ -0,0 +1,31 @@
|
||||
import { CARACS } from "../rdd-carac.js"
|
||||
import { DIFF, ROLL_TYPE_REVE_RESISTANCE } from "./roll-constants.mjs"
|
||||
import { RollType } from "./roll-type.mjs"
|
||||
|
||||
export class RollTypeReveResistance extends RollType {
|
||||
get code() { return ROLL_TYPE_REVE_RESISTANCE }
|
||||
get name() { return `fait un jet de résistance` }
|
||||
get icon() { return `systems/foundryvtt-reve-de-dragon/assets/ui/resistance.svg` }
|
||||
get chatResultTemplate() { return `systems/foundryvtt-reve-de-dragon/templates/roll/result/chat-reve-resistance.hbs` }
|
||||
|
||||
title(rollData) {
|
||||
return this.name
|
||||
}
|
||||
|
||||
setRollDataType(rollData) {
|
||||
foundry.utils.mergeObject(rollData, {
|
||||
selected: {
|
||||
carac: { key: CARACS.REVE_ACTUEL, forced: true },
|
||||
diff: { value: -8, type: DIFF.LIBRE },
|
||||
comp: { key: '', forced: true },
|
||||
conditions: { hide: true }
|
||||
}
|
||||
})
|
||||
super.setRollDataType(rollData)
|
||||
}
|
||||
|
||||
onSelect(rollData) {
|
||||
this.setDiffType(rollData, DIFF.LIBRE)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ export class RollType {
|
||||
return { code: this.code, name: this.name, icon: this.icon, section: 'type', template: this.template, selected: this.isSelected(rollData) }
|
||||
}
|
||||
|
||||
prepare(rollData){}
|
||||
prepare(rollData) {}
|
||||
isAllowed(rollData) { return rollData.type.allowed == undefined || rollData.type.allowed.includes(this.code) }
|
||||
visible(rollData) { return true }
|
||||
title(rollData) { return this.code }
|
||||
|
||||
@@ -10,7 +10,7 @@ const listeReglesOptionnelles = [
|
||||
{ group: 'Récupération', name: 'recuperation-reve', descr: "Récupérer le rêve pendant la nuit (les jets sont toujours faits pour les Rêves de Dragons)"},
|
||||
{ group: 'Récupération', name: 'recuperation-moral', descr: "Le moral revient vers 0 durant Château Dormant"},
|
||||
|
||||
|
||||
{ group: 'Règles de combat', name: 'armes-equipees', descr: "Proposer uniquement les armes équipées au combat", default: false},
|
||||
{ group: 'Règles de combat', name: 'localisation-aleatoire', descr: "Proposer une localisation aléatoire des blessures" },
|
||||
{ group: 'Règles de combat', name: 'recul', descr: "Appliquer le recul en cas de particulière en force ou de charge" },
|
||||
{ group: 'Règles de combat', name: 'acrobatie-pour-recul', descr: "L'acrobatie aide à ne pas chuter en cas de recul" , default: false },
|
||||
|
||||
@@ -8,7 +8,7 @@ export class DialogRepos extends Dialog {
|
||||
if (!actor.isPersonnage()) {
|
||||
return
|
||||
}
|
||||
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !actor.hasPlayerOwner) {
|
||||
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !actor.isPersonnageJoueur()) {
|
||||
foundry.utils.mergeObject(actor.system.sommeil, {
|
||||
"nouveaujour": true,
|
||||
"insomnie": EffetsDraconiques.isSujetInsomnie(actor),
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.8.0",
|
||||
"@foundryvtt/foundryvtt-cli": "^1.0.3",
|
||||
"@foundryvtt/foundryvtt-cli": "^3.0.3",
|
||||
"commander": "^11.1.0",
|
||||
"eslint": "^9.9.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
|
||||
@@ -2347,7 +2347,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2395,7 +2395,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 7
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2443,7 +2443,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2611,7 +2611,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 6
|
||||
categorie_parade: ''
|
||||
categorie_parade: haches
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2418,7 +2418,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2466,7 +2466,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2378,7 +2378,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2527,7 +2527,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 14
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 4/5
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2347,7 +2347,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2735,7 +2735,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 6
|
||||
categorie_parade: ''
|
||||
categorie_parade: haches
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2378,7 +2378,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2665,7 +2665,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2354,7 +2354,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2402,7 +2402,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2548,7 +2548,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2354,7 +2354,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2402,7 +2402,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2480,7 +2480,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2390,7 +2390,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2438,7 +2438,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2516,7 +2516,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2564,7 +2564,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2390,7 +2390,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2438,7 +2438,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2516,7 +2516,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2653,7 +2653,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2706,7 +2706,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 1
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2653,7 +2653,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2706,7 +2706,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 1
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2711,7 +2711,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2345,7 +2345,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2346,7 +2346,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2313,7 +2313,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2346,7 +2346,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2424,7 +2424,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2346,7 +2346,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2424,7 +2424,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: batons
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -27,7 +27,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: batons
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 7
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -22,7 +22,7 @@ system:
|
||||
rarete: Frequente
|
||||
frequence: 18
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2417,7 +2417,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2466,7 +2466,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2569,7 +2569,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2382,7 +2382,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 12
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-longues
|
||||
dommages: 3
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2441,7 +2441,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: haches
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2429,7 +2429,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2434,7 +2434,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2420,7 +2420,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 12
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-courtes
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 10
|
||||
categorie_parade: ''
|
||||
categorie_parade: masses
|
||||
dommages: 3/3
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2464,7 +2464,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2429,7 +2429,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2434,7 +2434,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2483,7 +2483,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2532,7 +2532,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 2
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2429,7 +2429,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -2380,7 +2380,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 5
|
||||
categorie_parade: ''
|
||||
categorie_parade: lances
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -2478,7 +2478,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 13
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -311,7 +311,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: epees-lourdes
|
||||
dommages: 3/4
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -359,7 +359,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 15
|
||||
categorie_parade: ''
|
||||
categorie_parade: boucliers
|
||||
dommages: 0
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
@@ -407,7 +407,7 @@ items:
|
||||
milieu: ''
|
||||
environnement: []
|
||||
resistance: 8
|
||||
categorie_parade: ''
|
||||
categorie_parade: dagues
|
||||
dommages: 1
|
||||
mortalite: mortel
|
||||
penetration: 0
|
||||
|
||||
@@ -4,24 +4,21 @@
|
||||
{{#each monnaies as |piece id|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{piece._id}}">
|
||||
<img class="sheet-competence-img" src="{{piece.img}}" data-tooltip="{{piece.name}}"/>
|
||||
<span class="equipement-nom">{{piece.name}}</span>
|
||||
<span class="equipement-valeur {{#unless (gt piece.system.cout 0)}}field-error{{/unless}}">
|
||||
({{piece.system.cout}} Sols)
|
||||
<span class="equipement-nom {{#unless (gt piece.system.cout 0)}}field-error{{/unless}}">
|
||||
{{piece.name}} ({{piece.system.cout}} Sols)
|
||||
</span>
|
||||
<span class="equipement-detail">
|
||||
{{#if @root.options.isOwner}}
|
||||
<span class="item-controls">
|
||||
<a class="item-quantite-moins"><i class="fa-solid fa-square-minus"></i></a>
|
||||
</span>
|
||||
{{/if}}
|
||||
<span>
|
||||
<span>{{piece.system.quantite}}</span>
|
||||
</span>
|
||||
{{#if @root.options.isOwner}}
|
||||
<span class="item-controls">
|
||||
<a class="item-quantite-plus"><i class="fa-solid fa-square-plus"></i></a>
|
||||
</span>
|
||||
{{/if}}
|
||||
{{#if @root.options.isOwner}}
|
||||
<span class="item-controls">
|
||||
<a class="item-quantite-moins"><i class="fa-solid fa-square-minus"></i></a>
|
||||
</span>
|
||||
<span class="equipement-detail">{{piece.system.quantite}}</span>
|
||||
<span class="item-controls">
|
||||
<a class="item-quantite-plus"><i class="fa-solid fa-square-plus"></i></a>
|
||||
</span>
|
||||
{{else}}
|
||||
{{piece.system.quantite}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{#if @root.options.isOwner}}
|
||||
{{>'systems/foundryvtt-reve-de-dragon/templates/actor/item-action-controls.hbs' item=signe options=@root.options}}
|
||||
|
||||
@@ -3,40 +3,40 @@
|
||||
<div class="flex-group-left">
|
||||
{{#if options.isGM}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||
label="Nom" path="name" type="text" value=current.name checked=checked.name
|
||||
label="Nom" fieldname="name" type="text" value=current.name checked=checked.name
|
||||
}}
|
||||
{{/if}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/sexe-aleatoire.hbs"
|
||||
label="Sexe" path="system.sexe" type="text"
|
||||
value=current.system.sexe checked=checked.system.sexe
|
||||
label="Sexe" fieldname="sexe" type="text"
|
||||
value=current.system.sexe checked=checked.sexe
|
||||
}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||
label="Age" path="system.age" type="entier" min=10 max=100
|
||||
value=current.system.age checked=checked.system.age
|
||||
label="Age" fieldname="age" type="entier" min=10 max=100
|
||||
value=current.system.age checked=checked.age
|
||||
}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||
label="Taille" path="system.taille" type="text"
|
||||
value=current.system.taille checked=checked.system.taille
|
||||
label="Taille" fieldname="taille" type="text"
|
||||
value=current.system.taille checked=checked.taille
|
||||
}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||
label="Poids" path="system.poids" type="text"
|
||||
value=current.system.poids checked=checked.system.poids
|
||||
label="Poids" fieldname="poids" type="text"
|
||||
value=current.system.poids checked=checked.poids
|
||||
}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||
label="Main directrice" path="system.main" type="text"
|
||||
value=current.system.main checked=checked.system.main
|
||||
label="Main directrice" fieldname="main" type="text"
|
||||
value=current.system.main checked=checked.main
|
||||
}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||
label="Heure de naissance" path="system.heure" type="heure"
|
||||
value=current.system.heure checked=checked.system.heure
|
||||
label="Heure de naissance" fieldname="heure" type="heure"
|
||||
value=current.system.heure checked=checked.heure
|
||||
}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||
label="Cheveux" path="system.cheveux" type="text"
|
||||
value=current.system.cheveux checked=checked.system.cheveux
|
||||
label="Cheveux" fieldname="cheveux" type="text"
|
||||
value=current.system.cheveux checked=checked.cheveux
|
||||
}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/random/champ-aleatoire.hbs"
|
||||
label="Yeux" path="system.yeux" type="text"
|
||||
value=current.system.yeux checked=checked.system.yeux
|
||||
label="Yeux" fieldname="yeux" type="text"
|
||||
value=current.system.yeux checked=checked.yeux
|
||||
}}
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<div class="flexrow random-field" data-path="{{path}}">
|
||||
<label for="{{path}}">{{label}}:</label>
|
||||
<div class="flexrow random-field" data-field-name="{{fieldname}}">
|
||||
<label for="{{fieldname}}">{{label}}:</label>
|
||||
{{#if (eq type 'entier')}}
|
||||
<input name="current.{{path}}" class="current-value" type="number" data-dtype="Number" placeholder="{{label}}" value="{{value}}" min="{{min}}" max="{{max}}"/>
|
||||
<input name="current.{{fieldname}}" class="current-value" type="number" data-dtype="Number" placeholder="{{label}}" value="{{value}}" min="{{min}}" max="{{max}}"/>
|
||||
{{else if (eq type 'heure')}}
|
||||
<select class="current-value" name="current.{{path}}" value="{{value}}" type="text" data-dtype="String">
|
||||
<select class="current-value" name="current.{{fieldname}}" value="{{value}}" type="text" data-dtype="String">
|
||||
{{#select value}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/enum-heures.hbs"}}
|
||||
{{/select}}
|
||||
</select>
|
||||
{{else}}
|
||||
<input name="current.{{path}}" class="current-value" type="text" data-dtype="String" value="{{value}}" placeholder="{{label}}"/>
|
||||
<input name="current.{{fieldname}}" class="current-value" type="text" data-dtype="String" value="{{value}}" placeholder="{{label}}"/>
|
||||
{{/if}}
|
||||
<div class="item-controls">
|
||||
<input class="check-for-random" type="checkbox" data-tooltip="Sélectionné pour génération automatique" {{#if checked}}checked{{/if}}/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="flexrow random-field" data-path="{{path}}">
|
||||
<label for="{{path}}">{{label}}:</label>
|
||||
<input class="current-value" name="current.{{path}}" value="{{value}}" placeholder="{{label}}" type="text" data-dtype="String"/>
|
||||
<div class="flexrow random-field" data-field-name="{{fieldname}}">
|
||||
<label for="{{fieldname}}">{{label}}:</label>
|
||||
<input class="current-value" name="current.{{fieldname}}" value="{{value}}" placeholder="{{label}}" type="text" data-dtype="String"/>
|
||||
<div class="item-controls">
|
||||
<input class="check-for-random" type="checkbox" data-tooltip="Sélectionné pour génération automatique" {{#if checked}}checked{{/if}}/>
|
||||
<a data-action="sexe-feminin" data-tooltip="sexe féminin"><i class="fa-solid fa-venus"></i></a>
|
||||
|
||||
21
templates/roll/result/chat-appel-chance.hbs
Normal file
21
templates/roll/result/chat-appel-chance.hbs
Normal file
@@ -0,0 +1,21 @@
|
||||
<div class="roll-chat">
|
||||
<div class="chat-img">
|
||||
<img src="{{active.img}}" data-tooltip="{{active.name}}" />
|
||||
<img src="{{current.comp.comp.img}}" data-tooltip="{{current.comp.label}}" />
|
||||
</div>
|
||||
<div class="chat-header">
|
||||
{{active.name}} fait appel à la chance
|
||||
</div>
|
||||
|
||||
<div class="chat-resume">
|
||||
{{> 'partial-infojet'}}
|
||||
</div>
|
||||
|
||||
<div class="chat-details">
|
||||
{{#if rolled.isSuccess}}
|
||||
<p>Un point de chance a été dépensé, le jet peut être retenté</p>
|
||||
{{else}}
|
||||
<p>Pas de dépense de chance</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
24
templates/roll/result/chat-reve-resistance.hbs
Normal file
24
templates/roll/result/chat-reve-resistance.hbs
Normal file
@@ -0,0 +1,24 @@
|
||||
<div class="roll-chat">
|
||||
<div class="chat-img">
|
||||
<img src="{{active.img}}" data-tooltip="{{active.name}}" />
|
||||
<img src="{{current.comp.comp.img}}" data-tooltip="{{current.comp.label}}" />
|
||||
</div>
|
||||
<div class="chat-header">
|
||||
{{active.name}} fait un jet de résistance
|
||||
</div>
|
||||
|
||||
<div class="chat-resume">
|
||||
{{> 'partial-infojet'}}
|
||||
</div>
|
||||
|
||||
<div class="chat-details">
|
||||
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/assets/ui/resistance.svg" />
|
||||
<span class="rdd-roll-{{rolled.code}} strong-text">
|
||||
{{#if rolled.isSuccess}}
|
||||
Jet de résistance réussi
|
||||
{{else}}
|
||||
Jet de résistance manqué
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user