#140 Permettre des jets de carac dérivées

This commit is contained in:
sladecraven 2021-02-10 11:24:14 +01:00
parent cddc6a8e9b
commit 6675539c59
5 changed files with 19 additions and 5 deletions

View File

@ -2530,7 +2530,7 @@ export class RdDActor extends Actor {
verifierForceMin( item ) {
if ( item.type == 'arme' && item.data.force > this.data.data.carac.force.value ) {
ChatMessage.create( { content: `<strong>${this.name} s'est équipé(e) de l'arme ${item.name}, mais n'a pas une force suffisante pour l'utiliser normalement </strong>
(${item.data.force} nécessaire pour unr Force de ${this.data.data.carac.force.value})` } );
(${item.data.force} nécessaire pour une Force de ${this.data.data.carac.force.value})` } );
}
}

View File

@ -4,12 +4,14 @@
*/
export class ChatUtility {
/* -------------------------------------------- */
static onSocketMessage(sockmsg) {
switch (sockmsg.msg) {
case "msg_delete_chat_message": return ChatUtility.onRemoveMessages(sockmsg.part, sockmsg.gmId);
}
}
/* -------------------------------------------- */
static onRemoveMessages(part, gmId) {
if (game.user._id == gmId) {
const toDelete = game.messages.filter(it => it.data.content.includes(part));

View File

@ -300,4 +300,9 @@ Hooks.on("chatMessage", (html, content, msg) => {
/* -------------------------------------------- */
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
RdDUtility.pushInitiativeOptions(html, options);
})
});
/* -------------------------------------------- */
Hooks.on("renderChatMessage", async (app, html, msg) => {
RdDUtility.onRenderChatMessage(app, html, msg);
});

View File

@ -1034,4 +1034,11 @@ export class RdDUtility {
});
}
}
/*-------------------------------------------- */
static async onRenderChatMessage( app, html, msg ) {
// TODO
//console.log(app, html, msg);
}
}

View File

@ -128,7 +128,7 @@
<label class="carac-xp flexrow"/>
{{else}}
{{#if carac.derivee}}
<span class="carac-label flexrow" name="data.carac.{{key}}.label">{{carac.label}}</span>
<span class="carac-label flexrow" name="data.carac.{{key}}.label"> <a name={{key}}>{{carac.label}}</a></span>
<label class="competence-value flexrow">{{carac.value}}</label>
<label class="carac-xp flexrow"/>
{{else}}