Merge pull request 'v13.0.34 - La saumuche d'Illysis' (#799) from feature/v13-corrections into v13
All checks were successful
Release Creation / build (release) Successful in 2m2s

Reviewed-on: https, #799
This commit was merged in pull request #799.
This commit is contained in:
2026-04-07 19:23:26 +02:00
11 changed files with 60 additions and 35 deletions

View File

@@ -1,5 +1,11 @@
# 13.0
## 13.0.34 - La saumuche d'Illysis
- la qualité des "improvisations du moment" se base sur le niveau du cuisinier
- l'appel au moral n'est pas affiché à l'ouverture d'une fenêtre de jets de sorts (ou de tâche intellectuelle)
- la difficulté variable de l'annulation de magie est bien prise en compte
## 13.0.33 - L'ébriété d'Illysis
- le stade éméché ne cause plus de perte d'endurance

View File

@@ -85,6 +85,10 @@ export const defaultItemImg = {
munition: "systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp"
}
const ITEM_TYPES_PLURIEL = {
[ITEM_TYPES.jeu]: 'jeux'
}
/* -------------------------------------------- */
export class RdDItem extends Item {
@@ -112,6 +116,14 @@ export class RdDItem extends Item {
return true;
}
static itemTypePluriel(type) {
if (ITEM_TYPES[type]) {
return ITEM_TYPES_PLURIEL[type] ?? (type + 's')
}
console.error(`Item type ${type} is undefined`)
return type
}
static async getCorrespondingItem(itemRef) {
if (itemRef.pack) {
return await SystemCompendiums.loadDocument(itemRef)

View File

@@ -1137,12 +1137,12 @@ export class RdDTMRDialog extends Dialog {
if (!token) {
return
}
if (this.demiReve === token && this.isDemiReveCache()) {
if (this.isDemiReveCache() && [EffetsDraconiques.rencontre.code(), EffetsDraconiques.demiReve.code()].includes(token.code)) {
return
}
this.pixiTMR.positionToken(token);
this.pixiTMR.positionToken(token)
if (!this.allTokens.includes(token)) {
this.allTokens.push(token);
this.allTokens.push(token)
}
}
}

View File

@@ -147,7 +147,7 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/oeuvre.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/jeux.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.hbs',
'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs',
@@ -483,7 +483,7 @@ export class RdDUtility {
static filterItemsPerTypeForSheet(formData, itemTypes) {
Object.values(ITEM_TYPES).forEach(t => {
formData[t + 's'] = Misc.arrayOrEmpty(itemTypes[t])
formData[RdDItem.itemTypePluriel(t)] = Misc.arrayOrEmpty(itemTypes[t])
itemTypes[t].forEach(item => item.actions = item.itemActions())
})

View File

@@ -479,16 +479,13 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
RollBasicParts.loadSurprises(rollData, this.getSelectedType().code)
rollData.type.label = this.getSelectedType()?.title(rollData)
const visibleRollParts = this.getActiveParts()
visibleRollParts.forEach(p => p.applyExternalImpacts(visibleRollParts, rollData))
this.setSpecialComp(visibleRollParts);
visibleRollParts.forEach(p => p.prepareContext(rollData))
this.getActiveParts().forEach(p => p.applyExternalImpacts(this.getActiveParts(), rollData))
this.setSpecialComp(this.getActiveParts());
this.getActiveParts().forEach(p => p.prepareContext(rollData))
RollDialog.calculAjustement(rollData)
const templates = visibleRollParts.map(p => p.toTemplateData())
const templates = this.getActiveParts().map(p => p.toTemplateData())
const context = await super._prepareContext()
return foundry.utils.mergeObject(
{

View File

@@ -39,18 +39,17 @@ export class RollPartCuisine extends RollPartSelect {
loadRefs(rollData) {
const refs = this.getRefs(rollData)
const actor = rollData.active.actor
refs.cuisine = actor.getCompetence('Cuisine')
const cuisine = actor.getCompetence('Cuisine')
const recettes = actor.items
.filter(it => it.type == ITEM_TYPES.recettecuisine)
.map(RollPartCuisine.$extractPreparationRecette)
.map(it => RollPartCuisine.$extractPreparationRecette(cuisine, it))
const ingredientsBruts = actor.items
.filter(it => it.getUtilisationCuisine() == 'brut')
.map(RollPartCuisine.$extractPreparationBrut)
.map(it => RollPartCuisine.$extractPreparationBrut(cuisine, it))
refs.preparations = [RollPartCuisine.$preparationBasique(), ...recettes, ...ingredientsBruts]
refs.preparations.forEach(p => p.comp = refs.cuisine)
refs.preparations = [RollPartCuisine.$preparationBasique(cuisine), ...recettes, ...ingredientsBruts]
if (refs.preparations.length > 0) {
this.$selectPreparation(rollData)
this.$restoreSavedOptions(rollData)
@@ -73,7 +72,7 @@ export class RollPartCuisine extends RollPartSelect {
choices(refs) { return refs.preparations }
static $preparationBasique() {
static $preparationBasique(cuisine) {
return {
key: '',
label: "Improvisation du moment",
@@ -85,10 +84,12 @@ export class RollPartCuisine extends RollPartSelect {
proportionsMax: 50,
value: 0,
fabriquer: false,
qualite: cuisine.system.niveau,
comp: cuisine,
}
}
static $extractPreparationRecette(recette) {
static $extractPreparationRecette(cuisine, recette) {
const proportions = recette.system.sust ?? 1
return {
key: recette.id,
@@ -102,10 +103,12 @@ export class RollPartCuisine extends RollPartSelect {
value: -recette.system.niveau,
recette: recette,
fabriquer: true,
qualite: recette.system.niveau,
comp: cuisine,
}
}
static $extractPreparationBrut(ingredient) {
static $extractPreparationBrut(cuisine, ingredient) {
return {
key: ingredient.id,
label: ingredient.name + ' cuisiné',
@@ -118,6 +121,8 @@ export class RollPartCuisine extends RollPartSelect {
value: 0,
ingredient: ingredient,
fabriquer: true,
qualite: cuisine.system.niveau,
comp: cuisine,
}
}
@@ -150,7 +155,7 @@ export class RollPartCuisine extends RollPartSelect {
this.$selectPreparation(rollDialog.rollData, selectOptions[index]?.value)
rollDialog.render()
})
checkboxFabriquer?.addEventListener("change", e => {
current.fabriquer = e.currentTarget.checked
})

View File

@@ -28,7 +28,8 @@ export class RollPartSort extends RollPartSelect {
this.setCurrent(rollData, {
key: saved.key,
isReserve: saved.isReserve,
ptreve: saved.ptreve
ptreve: saved.ptreve,
value: saved.value,
})
}
@@ -37,7 +38,8 @@ export class RollPartSort extends RollPartSelect {
this.setSaved(targetData, {
key: current.key,
isReserve: current.isReserve,
ptreve: current.ptreve
ptreve: current.ptreve,
value: current.value,
})
}
@@ -98,7 +100,7 @@ export class RollPartSort extends RollPartSelect {
const sort = { label: current.label, value: current.value }
const reserve = current.isReserve ? [{ label: `Mise en réserve en ${this.getCoord(rollData)}` }] : []
const bonusCase = current.bonusCase ? [{ label: `Bonus case +${current.bonusCase}%` }] : []
const reve = { label: `Rêve ${current.ptreve}` }
const reve = { label: `Dépense de rêve ${current.ptreve}` }
return [sort, ...bonusCase, reve, ...reserve]
}
return []
@@ -106,9 +108,12 @@ export class RollPartSort extends RollPartSelect {
$selectSort(rollData, values) {
const current = this.selectByKey(rollData, values.key)
if (values.ptreve) {
if (values.ptreve != undefined) {
current.ptreve = values.ptreve
}
if (current.isDiffVariable && values.value != undefined) {
current.value = values.value
}
if (values.isReserve != undefined) {
current.isReserve = values.isReserve
}

View File

@@ -21,9 +21,7 @@ export class RollTypeCuisine extends RollType {
getResult(rollData, impacts) {
const current = rollData.current[PART_CUISINE]
const diff = -current.value
const cuisine = rollData.refs[PART_CUISINE].cuisine
const qualite = rollData.rolled.ptQualite + (rollData.rolled.isSuccess ? diff : Math.min(diff, cuisine.system.niveau))
const qualite = rollData.rolled.ptQualite + current.qualite
const result = {
qualite: qualite,
@@ -49,6 +47,7 @@ export class RollTypeCuisine extends RollType {
}
return result
}
onApplyImpacts(roll, impacts) {
if (roll.result.plat) {
// le plat n'est pas créé immédiatement, il faut donc retrouver l'id

View File

@@ -90,21 +90,22 @@ export class Draconique {
*/
token(pixiTMR, linkData, coordTMR, type = undefined) {
const tooltip = this.tooltip(linkData);
return this._createToken(pixiTMR, linkData, coordTMR, type, tooltip);
return this._createToken(pixiTMR, linkData, coordTMR, type, tooltip)
}
tokens(pixiTMR, linkData, coordTMR, type = undefined) {
tokens(pixiTMR, linkData, coordTMR, code = undefined) {
const tooltip = this.tooltip(linkData);
return [this._createToken(pixiTMR, linkData, coordTMR, type, tooltip)];
return [this._createToken(pixiTMR, linkData, coordTMR, code, tooltip)]
}
_createToken(pixiTMR, linkData, coordTMR, type, tooltip) {
_createToken(pixiTMR, linkData, coordTMR, code, tooltip) {
const token = {
sprite: this.createSprite(pixiTMR),
coordTMR: coordTMR,
tooltip: tooltip
tooltip: tooltip,
code: code ?? this.code()
};
token[type ?? this.code()] = linkData;
token[code ?? this.code()] = linkData;
return token;
}

View File

@@ -122,7 +122,7 @@
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/taches.hbs"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.hbs"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/oeuvres.hbs"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeus.hbs"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/jeux.hbs"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.hbs"}}
</div>
{{/if}}