Corrections premiers retours
This commit is contained in:
11
changelog.md
11
changelog.md
@@ -1,4 +1,15 @@
|
||||
# 13.0
|
||||
## 13.0.13 - L'épanouissement d'Illysis
|
||||
|
||||
- Fix d'erreur au chargement de templates RollDialog
|
||||
- Nouvelle fenêtre de jets de dés
|
||||
- Fix: affichage des points de tâche
|
||||
- L'ouverture depuis les caractéristiques permet plusieurs types de jets
|
||||
- attaque/défense
|
||||
- les maladresses sont affichées dans le résultat du jet
|
||||
- le message au défenseur s'affiche correctement
|
||||
- la difficulté d'attaque s'applique à la défense
|
||||
- on peut choisir les particulières en rapidité
|
||||
|
||||
## 13.0.12 - La méditation d'Illysis
|
||||
|
||||
|
@@ -707,6 +707,10 @@ select,
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .chat-message div.roll-chat div.chat-details div,
|
||||
.system-foundryvtt-reve-de-dragon .dialog-content div.roll-chat div.chat-details div {
|
||||
display: block;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .chat-message div.roll-chat div.chat-actions,
|
||||
.system-foundryvtt-reve-de-dragon .dialog-content div.roll-chat div.chat-actions {
|
||||
grid-area: actions;
|
||||
@@ -1640,8 +1644,9 @@ select,
|
||||
height: 2rem;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon .window-app .window-content,
|
||||
.system-foundryvtt-reve-de-dragon .window-app.sheet .window-content .sheet-body {
|
||||
background: #f5f5f0 url(../assets/ui/bg_left.webp) no-repeat left top;
|
||||
.system-foundryvtt-reve-de-dragon .window-app.sheet .window-content .sheet-body,
|
||||
.system-foundryvtt-reve-de-dragon .application .window-content {
|
||||
background: url(../assets/ui/bg_left.webp) no-repeat left top;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon section.sheet-body {
|
||||
padding: 0.25rem 0.5rem;
|
||||
@@ -2316,7 +2321,7 @@ select,
|
||||
pointer-events: all;
|
||||
}
|
||||
.system-foundryvtt-reve-de-dragon div.horloge-roue div.horloge-cercle {
|
||||
background: hsl(60, 20%, 95%) url(../assets/ui/bg_left.webp) no-repeat left top;
|
||||
background: hsla(60, 20%, 90%, 0.8);
|
||||
top: 2%;
|
||||
left: 2%;
|
||||
width: 96%;
|
||||
|
@@ -955,8 +955,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.window-app .window-content, .window-app.sheet .window-content .sheet-body{
|
||||
background: rgb(245,245,240) url(../assets/ui/bg_left.webp) no-repeat left top;
|
||||
.window-app .window-content,
|
||||
.window-app.sheet .window-content .sheet-body,
|
||||
.application .window-content {
|
||||
background: url(../assets/ui/bg_left.webp) no-repeat left top;
|
||||
}
|
||||
|
||||
section.sheet-body {
|
||||
@@ -1677,7 +1679,7 @@
|
||||
}
|
||||
|
||||
div.horloge-roue div.horloge-cercle {
|
||||
background: hsl(60, 20%, 95%) url(../assets/ui/bg_left.webp) no-repeat left top;
|
||||
background: hsla(60, 20%, 90%, 0.8);
|
||||
top: 2%; left: 2%; width: 96%; height: 96%; border-radius: 50%;
|
||||
}
|
||||
|
||||
|
@@ -37,6 +37,9 @@
|
||||
text-align: justify;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
div {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
div.chat-actions {
|
||||
grid-area: actions;
|
||||
|
@@ -387,7 +387,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {
|
||||
const rollData = {
|
||||
ids: { actorId: this.id },
|
||||
type: { allowed: [PART_COMP], current: PART_COMP },
|
||||
type: { allowed: DEFAULT_ROLL_TYPES, current: PART_COMP },
|
||||
selected: {
|
||||
carac: { key: caracName },
|
||||
comp: options.resistance ? { key: undefined, forced: true } : undefined
|
||||
|
@@ -55,7 +55,7 @@ export const RDD_CONFIG = {
|
||||
particuliere: {
|
||||
force: { key: 'force', descr: 'en force', img: 'systems/foundryvtt-reve-de-dragon/assets/ui/part-force.svg'},
|
||||
finesse: { key: 'finesse', descr: 'en finesse', img: 'systems/foundryvtt-reve-de-dragon/assets/ui/part-finesse.svg'},
|
||||
rapidite: { key: 'finesse', descr: 'en rapidité', img: 'systems/foundryvtt-reve-de-dragon/assets/ui/part-rapidite.svg'},
|
||||
rapidite: { key: 'rapidite', descr: 'en rapidité', img: 'systems/foundryvtt-reve-de-dragon/assets/ui/part-rapidite.svg'},
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,9 +15,8 @@ import { RdDItemCompetence } from "./item-competence.js";
|
||||
import { MAP_PHASE, RdDInitiative } from "./initiative.mjs";
|
||||
import RollDialog from "./roll/roll-dialog.mjs";
|
||||
import { PART_DEFENSE } from "./roll/roll-part-defense.mjs";
|
||||
import { RollDialogAdapter } from "./roll/roll-dialog-adapter.mjs";
|
||||
import { ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE } from "./roll/roll-constants.mjs";
|
||||
import { OptionsAvancees, ROLL_DIALOG_V2, ROLL_DIALOG_V2_TEST } from "./settings/options-avancees.js";
|
||||
import { DIFF, ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE } from "./roll/roll-constants.mjs";
|
||||
import { OptionsAvancees, ROLL_DIALOG_V2 } from "./settings/options-avancees.js";
|
||||
import { MappingCreatureArme } from "./item/mapping-creature-arme.mjs";
|
||||
import { RollBasicParts } from "./roll/roll-basic-parts.mjs";
|
||||
|
||||
@@ -380,7 +379,7 @@ export class RdDCombat {
|
||||
if (defenderToken && Misc.isFirstConnectedGM()) {
|
||||
const rddCombat = RdDCombat.rddCombatForAttackerAndDefender(msg.attackerId, msg.attackerToken.id, msg.defenderToken.id)
|
||||
rddCombat?.removeChatMessageActionsPasseArme(msg.paramChatDefense.attackerRoll.passeArme)
|
||||
if (msg.defenderRoll.ids) {/* TODO: delete roll V1 */
|
||||
if (msg.defenderRoll.v2) {/* TODO: delete roll V1 */
|
||||
RollDialog.loadRollData(msg.paramChatDefense)
|
||||
rddCombat?._chatMessageDefenseV2(msg.paramChatDefense)
|
||||
} else {
|
||||
@@ -561,7 +560,7 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isEchecTotal(rollData) {
|
||||
if (rollData.ids /* roll V2*/) {
|
||||
if (rollData.v2 /* roll V2*/) {
|
||||
// TODO: en cas de demi-surprise à l'attaque, tout échec est un echec total.
|
||||
// TODO: en cas de demi-surprise en défense, pas de changement à la règle de base
|
||||
return rollData.rolled.isETotal
|
||||
@@ -575,7 +574,7 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isParticuliere(rollData) {
|
||||
if (rollData.ids /* roll V2*/) {
|
||||
if (rollData.v2 /* roll V2*/) {
|
||||
return rollData.rolled.isPart
|
||||
}
|
||||
if (rollData.attackerRoll || !rollData.ajustements.surprise.used) {
|
||||
@@ -586,7 +585,7 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isReussite(rollData) {
|
||||
if (rollData.ids /* roll V2*/) {
|
||||
if (rollData.v2 /* roll V2*/) {
|
||||
return rollData.rolled.isSuccess
|
||||
}
|
||||
if (!rollData.ajustements.surprise.used) {
|
||||
@@ -686,11 +685,7 @@ export class RdDCombat {
|
||||
async doRollAttaque(rollData, callbacks = []) {
|
||||
// TODO V2 await this.proposerAjustementTirLancer(rollData)
|
||||
await RollDialog.create(rollData, {
|
||||
onRollDone: (dialog) => {
|
||||
if (!OptionsAvancees.isUsing(ROLL_DIALOG_V2_TEST))
|
||||
dialog.close()
|
||||
},
|
||||
customChatMessage: true,
|
||||
onRollDone: RollDialog.onRollDoneClose,
|
||||
callbacks: [
|
||||
async (roll) => await this.onAttaqueV2(roll),
|
||||
...callbacks
|
||||
@@ -892,7 +887,10 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isPossession(attackerRoll) {
|
||||
return attackerRoll.selectedCarac.label.toLowerCase() == 'possession';
|
||||
const carac = attackerRoll.v2
|
||||
? attackerRoll.current.carac?.label
|
||||
: attackerRoll.selectedCarac.label
|
||||
return carac?.toLowerCase() == 'possession';
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -1067,7 +1065,7 @@ export class RdDCombat {
|
||||
opponentId: this.attackerId,
|
||||
},
|
||||
type: { allowed: [ROLL_TYPE_DEFENSE], current: ROLL_TYPE_DEFENSE },
|
||||
attackerRoll: RollDialogAdapter.mapActionAttaque(attackerRoll),
|
||||
attackerRoll: attackerRoll,
|
||||
passeArme: attackerRoll.passeArme,
|
||||
})
|
||||
}
|
||||
@@ -1075,7 +1073,6 @@ export class RdDCombat {
|
||||
async doRollDefense(rollData, callbacks = []) {
|
||||
await RollDialog.create(rollData, {
|
||||
onRollDone: RollDialog.onRollDoneClose,
|
||||
customChatMessage: true,
|
||||
callbacks: [
|
||||
async (roll) => {
|
||||
this.removeChatMessageActionsPasseArme(roll.passeArme);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChatUtility } from "../chat-utility.js"
|
||||
import RollDialog from "./roll-dialog.mjs"
|
||||
import RollDialog, { ALL_ROLL_TYPES } from "./roll-dialog.mjs"
|
||||
import { RdDCarac } from "../rdd-carac.js"
|
||||
import { RdDCombat } from "../rdd-combat.js"
|
||||
import { ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE } from "./roll-constants.mjs"
|
||||
@@ -24,6 +24,7 @@ export default class ChatRollResult {
|
||||
foundry.applications.handlebars.loadTemplates({
|
||||
'partial-appel-chance': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-appel-chance.hbs',
|
||||
'partial-attaque-particuliere': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-attaque-particuliere.hbs',
|
||||
'partial-choix-maladresse': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-choix-maladresse.hbs',
|
||||
'partial-maladresse': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-maladresse.hbs',
|
||||
'partial-encaissement': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-encaissement.hbs',
|
||||
'partial-recul-choc': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-recul-choc.hbs',
|
||||
@@ -122,7 +123,7 @@ export default class ChatRollResult {
|
||||
}
|
||||
|
||||
async buildRollHtml(roll) {
|
||||
const template = `systems/foundryvtt-reve-de-dragon/templates/roll/result/chat-${roll.type.current}.hbs`
|
||||
const template = ALL_ROLL_TYPES.find(it => it.code == roll.type.current).chatResultTemplate
|
||||
const html = await renderTemplate(template, roll)
|
||||
return await RdDTextEditor.enrichHTML(html, undefined, { showLink: false })
|
||||
}
|
||||
@@ -137,7 +138,6 @@ export default class ChatRollResult {
|
||||
$(html).on("click", '.monter-tmr-normale', event => this.onClickMonteeTMR(event, 'normal'))
|
||||
$(html).on("click", '.monter-tmr-rapide', event => this.onClickMonteeTMR(event, 'rapide'))
|
||||
$(html).on("click", '.tirer-maladresse', event => this.onClickTirerMaladresse(event))
|
||||
|
||||
}
|
||||
|
||||
getCombat(roll) {
|
||||
@@ -248,7 +248,7 @@ export default class ChatRollResult {
|
||||
savedRoll.particuliere = choix
|
||||
savedRoll.particulieres = [RDD_CONFIG.particuliere[choix]]
|
||||
await this.updateChatMessage(chatMessage, savedRoll)
|
||||
await this.getCombat(savedRoll)?.onAttaqueV2(savedRoll, callbacks)
|
||||
await this.getCombat(savedRoll)?.onAttaqueV2(savedRoll)
|
||||
}
|
||||
|
||||
async onClickFaireGouter(event) {
|
||||
@@ -273,8 +273,7 @@ export default class ChatRollResult {
|
||||
const chatMessage = ChatUtility.getChatMessage(event)
|
||||
const typeMaladresse = event.currentTarget.attributes['data-maladresse'].value
|
||||
const savedRoll = this.loadChatMessageRoll(chatMessage)
|
||||
await RdDRollTables.getMaladresse({ arme: typeMaladresse == 'avec-arme' })
|
||||
savedRoll.type.maladresse = true
|
||||
savedRoll.maladresse = await RdDRollTables.getMaladresse({ arme: typeMaladresse == 'avec-arme', toChat: false })
|
||||
savedRoll.type.retry = true
|
||||
await this.updateChatMessage(chatMessage, savedRoll)
|
||||
}
|
||||
|
@@ -13,7 +13,6 @@ export const ATTAQUE_ROLL_TYPES = [ROLL_TYPE_ATTAQUE]
|
||||
export const COMBAT_ROLL_TYPES = [ROLL_TYPE_ATTAQUE, ROLL_TYPE_DEFENSE]
|
||||
export const DEMIREVE_ROLL_TYPES = [ROLL_TYPE_SORT]
|
||||
export const DEFAULT_ROLL_TYPES = [ROLL_TYPE_COMP, ROLL_TYPE_TACHE, ROLL_TYPE_MEDITATION, ROLL_TYPE_CUISINE, ROLL_TYPE_OEUVRE, ROLL_TYPE_JEU]
|
||||
export const ALL_ROLL_TYPES = [...DEFAULT_ROLL_TYPES, ...COMBAT_ROLL_TYPES, ...DEMIREVE_ROLL_TYPES]
|
||||
|
||||
|
||||
export const DIFF = {
|
||||
|
@@ -48,7 +48,7 @@ import { ActorImpacts } from "../technical/actor-impacts.mjs";
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api
|
||||
|
||||
const ALL_ROLL_TYPES = [
|
||||
export const ALL_ROLL_TYPES = [
|
||||
new RollTypeComp(),
|
||||
new RollTypeTache(),
|
||||
new RollTypeAttaque(),
|
||||
@@ -175,11 +175,11 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
{
|
||||
static onCloseDoNothing() {
|
||||
}
|
||||
static onRollDoneDoNothing(dialog) {
|
||||
static onRollDoneDoNothing(dialog, roll) {
|
||||
dialog.render()
|
||||
}
|
||||
static onRollDoneClose(dialog) {
|
||||
if (!OptionsAvancees.isUsing(ROLL_DIALOG_V2_TEST))
|
||||
static onRollDoneClose(dialog, roll) {
|
||||
if (roll.type.retry || !OptionsAvancees.isUsing(ROLL_DIALOG_V2_TEST))
|
||||
dialog.close()
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
|
||||
ChatRollResult.onReady()
|
||||
|
||||
foundry.applications.handlebars.loadTemplates(ALL_ROLL_TYPES.map(m => m.template))
|
||||
foundry.applications.handlebars.loadTemplates(ALL_ROLL_TYPES.map(m => m.chatResultTemplate))
|
||||
foundry.applications.handlebars.loadTemplates(ROLL_PARTS.map(p => p.template))
|
||||
ROLL_PARTS.forEach(p => p.onReady())
|
||||
|
||||
@@ -323,11 +323,10 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
async r => await r.active.actor.appliquerAppelMoral(r),
|
||||
...(rollOptions.callbacks ?? [])
|
||||
],
|
||||
customChatMessage: rollOptions.customChatMessage,
|
||||
onRollDone: rollOptions.onRollDone ?? RollDialog.onRollDoneDoNothing,
|
||||
onClose: rollOptions.onClose ?? RollDialog.onCloseDoNothing
|
||||
}
|
||||
this.chatRollResult = new ChatRollResult();
|
||||
this.chatRollResult = new ChatRollResult()
|
||||
this.selectType()
|
||||
}
|
||||
|
||||
@@ -475,7 +474,7 @@ export default class RollDialog extends HandlebarsApplicationMixin(ApplicationV2
|
||||
await impacts.applyImpacts()
|
||||
selectedRollType.onApplyImpacts(roll, impacts)
|
||||
await this.chatRollResult.display(roll, impacts)
|
||||
this.rollOptions.onRollDone(this)
|
||||
this.rollOptions.onRollDone(this, roll)
|
||||
}
|
||||
|
||||
static loadRollData(roll) {
|
||||
|
@@ -123,7 +123,11 @@ export class RollPartDefense extends RollPartSelect {
|
||||
return { diff: 0, type: DIFF.LIBRE }
|
||||
}
|
||||
else {
|
||||
return { diff: rollData.attackerRoll.diff ?? 0, type: DIFF.DEFENSE }
|
||||
const attackerRoll = rollData.attackerRoll
|
||||
const diff = attackerRoll.v2
|
||||
? attackerRoll.selected.diff.value
|
||||
: attackerRoll.diff
|
||||
return { diff: diff ?? 0, type: DIFF.DEFENSE }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -56,11 +56,12 @@
|
||||
<p>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.hbs"}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="chat-actions">
|
||||
{{> 'partial-attaque-particuliere'}}
|
||||
{{> 'partial-maladresse'}}
|
||||
</div>
|
||||
|
||||
<div class="chat-actions">
|
||||
{{> 'partial-choix-maladresse'}}
|
||||
{{> 'partial-attaque-particuliere'}}
|
||||
{{!-- TODO: maladresses --}}
|
||||
</div>
|
||||
|
||||
|
@@ -4,16 +4,16 @@
|
||||
<img src="{{current.comp.comp.img}}" data-tooltip="{{current.comp.label}}" />
|
||||
</div>
|
||||
<div class="chat-header">
|
||||
{{active.name}} fait un jet de {{current.comp.label}}
|
||||
{{active.name}} fait un jet {{#if (eq current.comp.key '')}}sans compétence{{else}}de {{current.comp.label}}{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="chat-resume">
|
||||
{{current.carac.label}} / {{current.comp.label}} à {{current.diff.value}}
|
||||
{{current.carac.label}}{{#unless (eq current.comp.key '')}} / {{current.comp.label}}{{/unless}} à {{current.diff.value}}
|
||||
<br>{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.hbs"}}
|
||||
</div>
|
||||
|
||||
<div class="chat-details">
|
||||
<p>Qualité {{rolled.ptQualite}}, points de tâche {{rolled.ptQualite}}
|
||||
<p>Qualité {{rolled.ptQualite}}, points de tâche {{rolled.ptTache}}
|
||||
</p>
|
||||
{{> 'partial-info-appel-moral'}}
|
||||
</div>
|
||||
|
@@ -42,9 +42,11 @@
|
||||
</span>
|
||||
{{/if}}
|
||||
{{> 'partial-info-appel-moral'}}
|
||||
</div>
|
||||
<div class="chat-actions">
|
||||
{{> 'partial-maladresse'}}
|
||||
</div>
|
||||
|
||||
<div class="chat-actions">
|
||||
{{> 'partial-choix-maladresse'}}
|
||||
{{> 'partial-recul-choc'}}
|
||||
{{> 'partial-encaissement'}}
|
||||
</div>
|
||||
|
9
templates/roll/result/partial-choix-maladresse.hbs
Normal file
9
templates/roll/result/partial-choix-maladresse.hbs
Normal file
@@ -0,0 +1,9 @@
|
||||
{{#if show.maladresse}}
|
||||
{{#unless maladresse}}
|
||||
<a class='chat-card-button tirer-maladresse' data-maladresse='{{show.maladresse}}'
|
||||
data-tooltip="Tirer la maladresse">
|
||||
<img src="systems/foundryvtt-reve-de-dragon/assets/ui/maladresse.svg"/> Tirer une maladresse
|
||||
{{#if (eq show.maladresse 'avec-arme')}}armé{{else}}non armé{{/if}}
|
||||
</a>
|
||||
{{/unless}}
|
||||
{{/if}}
|
@@ -1,13 +1,6 @@
|
||||
{{#if show.maladresse}}
|
||||
{{#if type.maladresse}}
|
||||
<span class='chat-card-info'>
|
||||
<img src="systems/foundryvtt-reve-de-dragon/assets/ui/maladresse.svg"/> Maladresse!
|
||||
</span>
|
||||
{{else}}
|
||||
<a class='chat-card-button tirer-maladresse' data-maladresse='{{show.maladresse}}'
|
||||
data-tooltip="Tirer la maladresse">
|
||||
<img src="systems/foundryvtt-reve-de-dragon/assets/ui/maladresse.svg"/> Tirer une maladresse
|
||||
{{#if (eq show.maladresse 'avec-arme')}}armé{{else}}non armé{{/if}}
|
||||
</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if maladresse}}
|
||||
<span class='chat-card-info'>
|
||||
<img src="systems/foundryvtt-reve-de-dragon/assets/ui/maladresse.svg"/> Maladresse!
|
||||
</span>
|
||||
<div >{{{maladresse}}}</div>
|
||||
{{/if}}
|
||||
|
Reference in New Issue
Block a user