Améliorations des titres des fenêtres de jets
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
- Les rencontres et les maîtrises dans les TMR peuvent être vaincues sans
|
||||
draconic si les voies sont négatives
|
||||
- correction d'updates non affichés
|
||||
- Améliorations des titres des fenêtres de jets
|
||||
|
||||
## 13.0.47 - Les goûts et les couleurs d'Illisys
|
||||
|
||||
|
||||
+9
-4
@@ -1838,12 +1838,12 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
|
||||
async rollCaracCompetence(caracName, compName, diff, options = { title: undefined, verb: undefined }) {
|
||||
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [ROLL_TYPE_COMP], current: ROLL_TYPE_COMP },
|
||||
type: { allowed: [ROLL_TYPE_COMP], current: ROLL_TYPE_COMP, label: options.verb },
|
||||
selected: {
|
||||
carac: { key: caracName },
|
||||
comp: { key: compName, forced: options.forced },
|
||||
@@ -1879,6 +1879,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||
const tache = this.getTache(id)
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
options.title = options.title ?? 'Jet de Tâche'
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
selected: { tache: { key: tache.id, forced: options.forced } },
|
||||
@@ -2409,7 +2410,9 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
const tacheId = (await this.getTacheBlessure(blesse, blessure))?.id
|
||||
return await this.rollTache(tacheId, {
|
||||
callbacks: [async r => await blesse.callbackPremiersSoins(blessureId, r, this.id)],
|
||||
title: 'Premiers soins', forced: true
|
||||
verb: "soigne",
|
||||
title: 'Premiers soins',
|
||||
forced: true
|
||||
});
|
||||
}
|
||||
else if (!blessure.system.soinscomplets.done) {
|
||||
@@ -2417,7 +2420,9 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
return await this.rollCaracCompetence(CARACS.DEXTERITE, "Chirurgie", diff, {
|
||||
callbacks: [async r => await blesse.onRollSoinsComplets(blessureId, r, this.id)],
|
||||
onRollDone: RollDialog.onRollDoneClose,
|
||||
title: "Soins complets", forced: true
|
||||
verb: "applique des soins complets à",
|
||||
title: "Soins complets",
|
||||
forced: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ export class RdDCombatManager extends Combat {
|
||||
|
||||
|
||||
static getCombatant(actorId, tokenId) {
|
||||
return game.combat?.combatants.find(it => it.actor.id == actorId &&
|
||||
it.token.id == tokenId
|
||||
return game.combat?.combatants.find(it => it.actorId == actorId &&
|
||||
it.tokenId == tokenId
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
|
||||
this.hooks = []
|
||||
this.rollData = rollData
|
||||
this.rollOptions = {
|
||||
this.rollOptions = foundry.utils.mergeObject(rollOptions, {
|
||||
callbacks: [
|
||||
async r => await r.active.actor.ajoutExperience(r),
|
||||
async r => await r.active.actor.appliquerAppelMoral(r),
|
||||
@@ -387,7 +387,7 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
],
|
||||
onRollDone: rollOptions.onRollDone ?? RollDialog.onRollDoneDoNothing,
|
||||
onClose: rollOptions.onClose ?? RollDialog.onCloseDoNothing
|
||||
}
|
||||
})
|
||||
this.chatRollResult = new ChatRollResult()
|
||||
this.rollParts = RollDialog.getAllowedParts(rollData)
|
||||
|
||||
@@ -429,9 +429,10 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
.filter(it => it.section == ROLLDIALOG_SECTION.ACTION)
|
||||
.filter(it => it.isActive(rollData))
|
||||
.map(it => it.title(rollData))
|
||||
.filter(it => it != undefined)
|
||||
.reduce(Misc.joining(' '));
|
||||
if (this.rollOptions.title) {
|
||||
return `${this.rollOptions.title} ${title}`
|
||||
return `${this.rollOptions.title}: ${title}`
|
||||
}
|
||||
return title
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ export class RollPartAction extends RollPart {
|
||||
get section() { return ROLLDIALOG_SECTION.ACTION }
|
||||
|
||||
title(rollData) {
|
||||
return rollData.type.label
|
||||
const current = this.getCurrent(rollData)
|
||||
return current.verb
|
||||
}
|
||||
|
||||
prepareContext(rollData) {
|
||||
|
||||
@@ -7,6 +7,8 @@ export class RollTypeAttaque extends RollType {
|
||||
|
||||
title(rollData) { return `attaque` }
|
||||
|
||||
isOpposed(rollData) { return rollData.opponent != undefined }
|
||||
|
||||
onSelect(rollData) {
|
||||
this.setDiffType(rollData, DIFF.ATTAQUE)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ export class RollTypeComp extends RollType {
|
||||
get name() { return `Jet de caractéristique / compétence` }
|
||||
|
||||
title(rollData) {
|
||||
if (rollData.type.label) {
|
||||
return rollData.type.label
|
||||
}
|
||||
if (rollData.type.appreciation) {
|
||||
return "fait un jet d'appéciation"
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ export class RollTypeDefense extends RollType {
|
||||
|
||||
title(rollData) { return `se défend${rollData.opponent ? ' de' : ''}` }
|
||||
|
||||
isOpposed(rollData) { return this.getOpponent(rollData) != undefined }
|
||||
|
||||
getOpponent(rollData) {
|
||||
return rollData.attacker
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ export class RollTypeJeu extends RollType {
|
||||
&& RollConstants.findCompetence(rollData, 'Jeu')
|
||||
}
|
||||
|
||||
isOpposed(rollData) { return rollData.opponent != undefined }
|
||||
|
||||
|
||||
title(rollData) {
|
||||
if (rollData.opponent) {
|
||||
return `joue contre`
|
||||
|
||||
@@ -14,6 +14,8 @@ export class RollTypePossession extends RollType {
|
||||
return RdDPossessionV2.actionTitle(rollData.type.possession.action)
|
||||
}
|
||||
|
||||
isOpposed(rollData) { return rollData.opponent != undefined }
|
||||
|
||||
onSelect(rollData) {
|
||||
this.setDiffType(rollData, this.isAttaque(rollData) ? DIFF.ATTAQUE : DIFF.DEFENSE)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export class RollTypeTache extends RollType {
|
||||
title(rollData) {
|
||||
const current = rollData.current[PART_TACHE]
|
||||
const tache = current?.tache
|
||||
return tache ? `travaille à sa tâche: ${tache.name}` : `n'a pas de tâches à travailler`
|
||||
return tache ? "travaille à la tâche" : "n'a pas de tâches en cours"
|
||||
}
|
||||
|
||||
onSelect(rollData) {
|
||||
|
||||
@@ -19,9 +19,10 @@ export class RollType {
|
||||
visible(rollData) { return true }
|
||||
title(rollData) { return this.code }
|
||||
isSelected(rollData) { return rollData.type.current == this.code }
|
||||
isOpposed(rollData) { return false }
|
||||
|
||||
setRollDataType(rollData) {
|
||||
rollData.type.opposed = rollData.opponent != undefined
|
||||
rollData.type.opposed = this.isOpposed(rollData)
|
||||
}
|
||||
|
||||
onSelect(rollData) {
|
||||
|
||||
Reference in New Issue
Block a user