Update CSS/Look & feel

This commit is contained in:
2026-04-03 00:39:39 +02:00
parent 23b105a47e
commit 9754bbc3a8
265 changed files with 12355 additions and 47899 deletions

View File

@@ -16,15 +16,12 @@ export class MournbladeCYD2RollDialog {
difficulte: String(rollData.difficulte || 0),
img: actor.img,
name: actor.name,
config: game.system.mournbladecyd2.config
config: game.system.mournbladecyd2.config,
attributs: game.system.mournbladecyd2.config.attributs,
};
if (rollData.attrKey === "tochoose") {
context.selectableAttributes = actor.system.attributs;
}
const content = await foundry.applications.handlebars.renderTemplate(
"systems/fvtt-mournblade-cyd2/templates/roll-dialog-generic.hbs",
"systems/fvtt-mournblade-cyd-2-0/templates/roll-dialog-generic.hbs",
context
);

View File

@@ -16,10 +16,10 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
/** @override */
static DEFAULT_OPTIONS = {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
classes: ["fvtt-mournblade-cyd-2-0", "sheet", "actor"],
position: {
width: 640,
height: 720,
width: 750,
height: 820,
},
form: {
submitOnChange: true,
@@ -44,6 +44,7 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
createItem: MournbladeCYD2ActorSheetV2.#onCreateItem,
equipItem: MournbladeCYD2ActorSheetV2.#onEquipItem,
modifyQuantity: MournbladeCYD2ActorSheetV2.#onModifyQuantity,
modifyAdversite: MournbladeCYD2ActorSheetV2.#onModifyAdversite,
modifySante: MournbladeCYD2ActorSheetV2.#onModifySante,
modifyAme: MournbladeCYD2ActorSheetV2.#onModifyAme,
rollAttribut: MournbladeCYD2ActorSheetV2.#onRollAttribut,
@@ -53,7 +54,11 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
rollArmeSpecial: MournbladeCYD2ActorSheetV2.#onRollArmeSpecial,
rollArmeDegats: MournbladeCYD2ActorSheetV2.#onRollArmeDegats,
rollAssommer: MournbladeCYD2ActorSheetV2.#onRollAssommer,
rollCoupBas: MournbladeCYD2ActorSheetV2.#onRollCoupBas,
rollImmobiliser: MournbladeCYD2ActorSheetV2.#onRollImmobiliser,
rollRepousser: MournbladeCYD2ActorSheetV2.#onRollRepousser,
rollDesengager: MournbladeCYD2ActorSheetV2.#onRollDesengager,
rollInitiative: MournbladeCYD2ActorSheetV2.#onRollInitiative,
rollFuir: MournbladeCYD2ActorSheetV2.#onRollFuir,
},
};
@@ -226,6 +231,15 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
}
}
static async #onModifyAdversite(event, target) {
const li = target.closest('[data-adversite]');
const adversiteKey = li?.dataset.adversite;
if (!adversiteKey) return;
const value = Number.parseInt(target.dataset.adversiteValue);
const current = this.document.system.adversite[adversiteKey] || 0;
await this.document.update({ [`system.adversite.${adversiteKey}`]: Math.max(0, current + value) });
}
static async #onModifySante(event, target) {
const type = target.dataset.type;
const value = Number.parseInt(target.dataset.value);
@@ -254,25 +268,44 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix
}
static async #onRollArmeOffensif(event, target) {
await this.document.rollArmeOffensif(target.dataset.armeId);
const li = target.closest('[data-item-id]');
await this.document.rollArmeOffensif(target.dataset.armeId ?? li?.dataset.itemId);
}
static async #onRollArmeSpecial(event, target) {
await this.document.rollArmeSpecial(target.dataset.armeId);
const li = target.closest('[data-item-id]');
await this.document.rollArmeSpecial(target.dataset.armeId ?? li?.dataset.itemId);
}
static async #onRollArmeDegats(event, target) {
await this.document.rollArmeDegats(target.dataset.armeId);
const li = target.closest('[data-item-id]');
await this.document.rollArmeDegats(target.dataset.armeId ?? li?.dataset.itemId);
}
static async #onRollAssommer(event, target) {
await this.document.rollAssomer();
}
static async #onRollCoupBas(event, target) {
await this.document.rollCoupBas();
}
static async #onRollImmobiliser(event, target) {
await this.document.rollImmobiliser();
}
static async #onRollRepousser(event, target) {
await this.document.rollRepousser();
}
static async #onRollDesengager(event, target) {
await this.document.rollDesengager();
}
static async #onRollInitiative(event, target) {
await this.document.rollAttribut("adr", true);
}
static async #onRollFuir(event, target) {
await this.document.rollFuir();
}

View File

@@ -13,7 +13,7 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
/** @override */
static DEFAULT_OPTIONS = {
classes: ["fvtt-mournblade-cyd2", "item"],
classes: ["fvtt-mournblade-cyd-2-0", "item"],
position: {
width: 620,
height: 600,
@@ -107,7 +107,24 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
}
static async #onPostItem(event) {
await this.document.toChat?.();
event.preventDefault();
const item = this.document;
const chatData = foundry.utils.duplicate(item);
if (item.actor) {
chatData.actor = { id: item.actor.id };
}
if (chatData.img?.includes("/blank.png")) {
chatData.img = null;
}
chatData.jsondata = JSON.stringify({
compendium: "postedItem",
payload: chatData,
});
const html = await foundry.applications.handlebars.renderTemplate(
"systems/fvtt-mournblade-cyd-2-0/templates/post-item.hbs",
chatData
);
ChatMessage.create({ user: game.user.id, content: html });
}
static async #onAddPredilection(event) {

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2ArmeSheet extends MournbladeCYD2ItemSheetV2 {
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-arme-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-arme-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2CompetenceSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-competence-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-competence-sheet.hbs",
},
};

View File

@@ -1,4 +1,5 @@
import MournbladeCYD2ActorSheetV2 from "./base-actor-sheet.mjs";
import { MournbladeCYD2Utility } from "../../mournblade-cyd2-utility.js";
export default class MournbladeCYD2CreatureSheet extends MournbladeCYD2ActorSheetV2 {
@@ -15,7 +16,7 @@ export default class MournbladeCYD2CreatureSheet extends MournbladeCYD2ActorShee
/** @override */
static PARTS = {
sheet: {
template: "systems/fvtt-mournblade-cyd2/templates/creature-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/creature-sheet.hbs",
},
};
@@ -28,6 +29,7 @@ export default class MournbladeCYD2CreatureSheet extends MournbladeCYD2ActorShee
const actor = this.document;
context.skills = actor.getSkills?.() ?? [];
context.combativiteList = MournbladeCYD2Utility.getCombativiteList(actor.system.sante?.nbcombativite || 0);
context.armes = foundry.utils.duplicate(actor.getWeapons?.() ?? []);
context.protections = foundry.utils.duplicate(actor.getArmors?.() ?? []);
context.runes = foundry.utils.duplicate(actor.getRunes?.() ?? []);

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2DonSheet extends MournbladeCYD2ItemSheetV2 {
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-don-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-don-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2EquipementSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-equipement-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-equipement-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2HistoriqueSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-historique-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-historique-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2MonnaieSheet extends MournbladeCYD2ItemSheetV
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-monnaie-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-monnaie-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2PacteSheet extends MournbladeCYD2ItemSheetV2
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-pacte-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-pacte-sheet.hbs",
},
};

View File

@@ -1,4 +1,5 @@
import MournbladeCYD2ActorSheetV2 from "./base-actor-sheet.mjs";
import { MournbladeCYD2Utility } from "../../mournblade-cyd2-utility.js";
export default class MournbladeCYD2PersonnageSheet extends MournbladeCYD2ActorSheetV2 {
@@ -15,7 +16,7 @@ export default class MournbladeCYD2PersonnageSheet extends MournbladeCYD2ActorSh
/** @override */
static PARTS = {
sheet: {
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/actor-sheet.hbs",
},
};
@@ -27,6 +28,10 @@ export default class MournbladeCYD2PersonnageSheet extends MournbladeCYD2ActorSh
const context = await super._prepareContext();
const actor = this.document;
context.combativiteList = MournbladeCYD2Utility.getCombativiteList(actor.system.sante.nbcombativite);
context.ameList = MournbladeCYD2Utility.getAmeList(actor.system.ame.nbame, actor.getAmeMax?.() ?? 0);
context.ameMaxList = MournbladeCYD2Utility.getAmeMaxList(actor.system.ame.nbame);
context.skills = actor.getSkills?.() ?? [];
context.armes = foundry.utils.duplicate(actor.getWeapons?.() ?? []);
context.protections = foundry.utils.duplicate(actor.getArmors?.() ?? []);

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2ProfilSheet extends MournbladeCYD2ItemSheetV2
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-profil-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-profil-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2ProtectionSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-protection-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-protection-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2RessourceSheet extends MournbladeCYD2ItemShee
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-ressource-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-ressource-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2RuneSheet extends MournbladeCYD2ItemSheetV2 {
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-rune-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-rune-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2RuneEffectSheet extends MournbladeCYD2ItemShe
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-runeeffect-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-runeeffect-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2TalentSheet extends MournbladeCYD2ItemSheetV2
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-talent-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-talent-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2TendanceSheet extends MournbladeCYD2ItemSheet
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-tendance-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-tendance-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2TraitChaotiqueSheet extends MournbladeCYD2Ite
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-traitchaotique-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-traitchaotique-sheet.hbs",
},
};

View File

@@ -15,7 +15,7 @@ export default class MournbladeCYD2TraitEspeceSheet extends MournbladeCYD2ItemSh
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-mournblade-cyd2/templates/item-traitespece-sheet.hbs",
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-traitespece-sheet.hbs",
},
};

View File

@@ -1,6 +1,6 @@
/**
* Macro pour remplacer les chemins d'images dans les compendiums
* Remplace "fvtt-hawkmoon-cyd" par "fvtt-mournblade-cyd2" dans tous les champs 'img'
* Remplace "fvtt-hawkmoon-cyd" par "fvtt-mournblade-cyd-2-0" dans tous les champs 'img'
*/
(async () => {
@@ -10,7 +10,7 @@
content: `<p>Cette macro va :</p>
<ul>
<li>Déverrouiller tous les compendiums</li>
<li>Remplacer "fvtt-hawkmoon-cyd" par "fvtt-mournblade-cyd2" dans tous les champs 'img'</li>
<li>Remplacer "fvtt-hawkmoon-cyd" par "fvtt-mournblade-cyd-2-0" dans tous les champs 'img'</li>
<li>Reverrouiller les compendiums</li>
</ul>
<p><strong>Voulez-vous continuer ?</strong></p>`,
@@ -49,14 +49,14 @@
// Vérifier le champ img principal
if (doc.img && doc.img.includes("fvtt-hawkmoon-cyd")) {
updateData.img = doc.img.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
updateData.img = doc.img.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd-2-0");
needsUpdate = true;
}
// Pour les acteurs, vérifier aussi prototypeToken.texture.src
if (doc.documentName === "Actor" && doc.prototypeToken?.texture?.src) {
if (doc.prototypeToken.texture.src.includes("fvtt-hawkmoon-cyd")) {
updateData["prototypeToken.texture.src"] = doc.prototypeToken.texture.src.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
updateData["prototypeToken.texture.src"] = doc.prototypeToken.texture.src.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd-2-0");
needsUpdate = true;
}
}
@@ -74,7 +74,7 @@
// Pour les scènes, vérifier background.src et les tokens
if (doc.documentName === "Scene") {
if (doc.background?.src && doc.background.src.includes("fvtt-hawkmoon-cyd")) {
updateData["background.src"] = doc.background.src.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
updateData["background.src"] = doc.background.src.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd-2-0");
needsUpdate = true;
}
}

View File

@@ -13,8 +13,8 @@ export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.hbs",
classes: ["fvtt-mournblade-cyd-2-0", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd-2-0/templates/actor-sheet.hbs",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],

View File

@@ -39,14 +39,14 @@ export class MournbladeCYD2Actor extends Actor {
if (data.type == 'personnage') {
console.log("Loading skills for personnage")
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd2.skills")
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd-2-0.skills")
data.items = skills.map(i => i.toObject())
}
if (data.type == 'creature') {
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd2.skills-creatures")
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd-2-0.skills-creatures")
data.items = skills.map(i => i.toObject())
data.items.push({ name: "Arme naturelle 1", type: 'arme', img: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0" } })
data.items.push({ name: "Arme naturelle 2", type: 'arme', img: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0" } })
data.items.push({ name: "Arme naturelle 1", type: 'arme', img: "systems/fvtt-mournblade-cyd-2-0/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0" } })
data.items.push({ name: "Arme naturelle 2", type: 'arme', img: "systems/fvtt-mournblade-cyd-2-0/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0" } })
}
return super.create(data, options);
@@ -246,9 +246,6 @@ export class MournbladeCYD2Actor extends Actor {
return combat
}
/* -------------------------------------------- */
prepareBaseData() {
}
/* -------------------------------------------- */
async prepareData() {
@@ -751,7 +748,7 @@ export class MournbladeCYD2Actor extends Actor {
if (attrKey) {
rollData.attrKey = attrKey
if (attrKey != "tochoose") {
rollData.actionImg = "systems/fvtt-mournblade-cyd2/assets/icons/" + this.system.attributs[attrKey].labelnorm + ".webp"
rollData.actionImg = "systems/fvtt-mournblade-cyd-2-0/assets/icons/" + this.system.attributs[attrKey].labelnorm + ".webp"
rollData.attr = foundry.utils.duplicate(this.system.attributs[attrKey])
}
}
@@ -779,8 +776,7 @@ export class MournbladeCYD2Actor extends Actor {
let rollData = this.getCommonRollData(attrKey)
rollData.multiplier = (isInit) ? 1 : 2
rollData.isInit = isInit
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
@@ -788,8 +784,7 @@ export class MournbladeCYD2Actor extends Actor {
let rollData = this.getCommonRollData(attrKey, compId)
rollData.multiplier = 1 // Attr multiplier, always 1 in competence mode
console.log("RollDatra", rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
@@ -802,8 +797,7 @@ export class MournbladeCYD2Actor extends Actor {
rollData.arme = arme
MournbladeCYD2Utility.updateWithTarget(rollData)
console.log("ARME!", rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollAssommer() {
@@ -811,8 +805,7 @@ export class MournbladeCYD2Actor extends Actor {
rollData.assomer = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollCoupBas() {
@@ -820,8 +813,7 @@ export class MournbladeCYD2Actor extends Actor {
rollData.coupBas = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollImmobiliser() {
@@ -830,8 +822,7 @@ export class MournbladeCYD2Actor extends Actor {
rollData.conditionsCommunes = true
rollData.cibleconsciente = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollRepousser() {
@@ -840,8 +831,7 @@ export class MournbladeCYD2Actor extends Actor {
rollData.conditionsCommunes = true
rollData.cibleconsciente = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
async rollDesengager() {
@@ -849,8 +839,7 @@ export class MournbladeCYD2Actor extends Actor {
rollData.desengager = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
await MournbladeCYD2RollDialog.create(this, rollData)
}
/* -------------------------------------------- */
@@ -908,7 +897,7 @@ export class MournbladeCYD2Actor extends Actor {
nbEtatPerdus: nbEtatPerdus
}
MournbladeCYD2Utility.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-mournblade-cyd2/templates/chat-degats-result.hbs`, rollData)
content: await renderTemplate(`systems/fvtt-mournblade-cyd-2-0/templates/chat-degats-result.hbs`, rollData)
})
if (rollDataInput?.defenderTokenId && nbEtatPerdus) {

View File

@@ -1,4 +1,11 @@
export const MOURNBLADECYD2_CONFIG = {
attributs: {
adr: "Adresse",
pui: "Puissance",
cla: "Clairvoyance",
pre: "Présence",
tre: "Trempe"
},
allegeanceOptions: {
tous: 'Tous',
chaos: 'Chaos',

View File

@@ -14,8 +14,8 @@ export class MournbladeCYD2CreatureSheet extends MournbladeCYD2ActorSheet {
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/creature-sheet.hbs",
classes: ["fvtt-mournblade-cyd-2-0", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd-2-0/templates/creature-sheet.hbs",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],

View File

@@ -24,7 +24,7 @@ export class MournbladeCYD2TokenHud {
const controlIconActions = $(html).find('.control-icon[data-action=combat]');
// initiative
await MournbladeCYD2TokenHud._configureSubMenu(controlIconActions, 'systems/fvtt-mournblade-cyd2/templates/hud-adversites.hbs', hudData,
await MournbladeCYD2TokenHud._configureSubMenu(controlIconActions, 'systems/fvtt-mournblade-cyd-2-0/templates/hud-adversites.hbs', hudData,
(event) => {
let adversite = event.currentTarget.attributes['data-action-index'].value
let value = Number(event.currentTarget.attributes['data-action-value'].value)

View File

@@ -10,8 +10,8 @@ export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet {
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "item"],
template: "systems/fvtt-mournblade-cyd2/templates/item-sheet.hbs",
classes: ["fvtt-mournblade-cyd-2-0", "sheet", "item"],
template: "systems/fvtt-mournblade-cyd-2-0/templates/item-sheet.hbs",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
@@ -105,7 +105,7 @@ export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet {
payload: chatData,
});
renderTemplate('systems/fvtt-mournblade-cyd2/templates/post-item.hbs', chatData).then(html => {
renderTemplate('systems/fvtt-mournblade-cyd-2-0/templates/post-item.hbs', chatData).then(html => {
let chatOptions = MournbladeCYD2Utility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
@@ -217,7 +217,7 @@ export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet {
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-mournblade-cyd2/templates/item-${type}-sheet.hbs`;
return `systems/fvtt-mournblade-cyd-2-0/templates/item-${type}-sheet.hbs`;
}
/* -------------------------------------------- */

View File

@@ -1,22 +1,22 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd2/assets/icons/traitchaotique.webp",
traitespece: "systems/fvtt-mournblade-cyd2/assets/icons/traitespece.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp",
tendance: "systems/fvtt-mournblade-cyd2/assets/icons/tendance.webp",
competence: "systems/fvtt-mournblade-cyd-2-0/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd-2-0/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd-2-0/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd-2-0/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd-2-0/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd-2-0/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd-2-0/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd-2-0/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd-2-0/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd-2-0/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd-2-0/assets/icons/traitchaotique.webp",
traitespece: "systems/fvtt-mournblade-cyd-2-0/assets/icons/traitespece.webp",
don: "systems/fvtt-mournblade-cyd-2-0/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd-2-0/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd-2-0/assets/icons/rune.webp",
tendance: "systems/fvtt-mournblade-cyd-2-0/assets/icons/tendance.webp",
}
/**

View File

@@ -40,7 +40,7 @@ Hooks.once("init", async function () {
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-mournblade-cyd2", data => {
game.socket.on("system.fvtt-mournblade-cyd-2-0", data => {
MournbladeCYD2Utility.onSocketMesssage(data)
});
@@ -79,26 +79,26 @@ Hooks.once("init", async function () {
// Register sheet application classes (AppV2)
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2PersonnageSheet, { types: ["personnage"], makeDefault: true });
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2CreatureSheet, { types: ["creature"], makeDefault: true });
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2PersonnageSheet, { types: ["personnage"], makeDefault: true });
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2CreatureSheet, { types: ["creature"], makeDefault: true });
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2CompetenceSheet, { types: ["competence"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2TalentSheet, { types: ["talent"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2HistoriqueSheet, { types: ["historique"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2ProfilSheet, { types: ["profil"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2ArmeSheet, { types: ["arme"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2ProtectionSheet, { types: ["protection"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2MonnaieSheet, { types: ["monnaie"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2EquipementSheet, { types: ["equipement"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2RessourceSheet, { types: ["ressource"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2DonSheet, { types: ["don"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2PacteSheet, { types: ["pacte"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2RuneSheet, { types: ["rune"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2RuneEffectSheet, { types: ["runeeffect"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2TendanceSheet, { types: ["tendance"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2TraitChaotiqueSheet, { types: ["traitchaotique"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", sheets.MournbladeCYD2TraitEspeceSheet, { types: ["traitespece"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2CompetenceSheet, { types: ["competence"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2TalentSheet, { types: ["talent"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2HistoriqueSheet, { types: ["historique"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2ProfilSheet, { types: ["profil"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2ArmeSheet, { types: ["arme"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2ProtectionSheet, { types: ["protection"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2MonnaieSheet, { types: ["monnaie"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2EquipementSheet, { types: ["equipement"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2RessourceSheet, { types: ["ressource"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2DonSheet, { types: ["don"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2PacteSheet, { types: ["pacte"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2RuneSheet, { types: ["rune"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2RuneEffectSheet, { types: ["runeeffect"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2TendanceSheet, { types: ["tendance"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2TraitChaotiqueSheet, { types: ["traitchaotique"], makeDefault: true });
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd-2-0", sheets.MournbladeCYD2TraitEspeceSheet, { types: ["traitespece"], makeDefault: true });
MournbladeCYD2Utility.init()
MournbladeCYD2Automation.init()
@@ -123,7 +123,7 @@ function welcomeMessage() {
async function importDefaultScene() {
let exists = game.scenes.find(j => j.name == "Accueil");
if (!exists) {
const scenes = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd2.scenes")
const scenes = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd-2-0.scenes")
let newDocuments = scenes.filter(i => i.name == "Accueil");
if (newDocuments) {
await game.scenes.documentClass.create(newDocuments);

View File

@@ -6,7 +6,7 @@ export class MournbladeCYD2RollDialog extends Dialog {
static async create(actor, rollData ) {
let options = { classes: ["MournbladeCYD2Dialog"], width: 320, height: 'fit-content', 'z-index': 99999 };
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-mournblade-cyd2/templates/roll-dialog-generic.hbs', rollData);
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-mournblade-cyd-2-0/templates/roll-dialog-generic.hbs', rollData);
return new MournbladeCYD2RollDialog(actor, rollData, html, options );
}

View File

@@ -47,7 +47,7 @@ export class MournbladeCYD2Utility {
return parseInt(a) * parseInt(b);
})
game.settings.register("fvtt-mournblade-cyd2", "mournblade-cyd2-pause-logo", {
game.settings.register("fvtt-mournblade-cyd-2-0", "mournblade-cyd2-pause-logo", {
name: "Logo de pause",
scope: "world",
config: true,
@@ -60,6 +60,10 @@ export class MournbladeCYD2Utility {
},
})
// Initialise les listes de sélection dès le hook init (avant le rendu des fiches)
game.system.mournbladecyd2.config.listeNiveauSkill = this.createDirectOptionList(0, 10)
game.system.mournbladecyd2.config.listeNiveauCreature = this.createDirectOptionList(0, 35)
}
/* -------------------------------------------- */
@@ -102,16 +106,13 @@ export class MournbladeCYD2Utility {
/* -------------------------------------------- */
static async ready() {
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd2.skills")
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd-2-0.skills")
this.skills = skills.map(i => i.toObject())
// Setup pause logo
let logoPause = "systems/fvtt-mournblade-cyd2/assets/logos/" + game.settings.get("fvtt-mournblade-cyd2", "mournblade-cyd2-pause-logo") + ".webp"
let logoPause = "systems/fvtt-mournblade-cyd-2-0/assets/logos/" + game.settings.get("fvtt-mournblade-cyd-2-0", "mournblade-cyd2-pause-logo") + ".webp"
let logoImg = document.querySelector('#pause').children[0]
logoImg.setAttribute('style', `content: url(${logoPause})`)
game.system.mournbladecyd2.config.listeNiveauSkill = this.createDirectOptionList(0, 10)
game.system.mournbladecyd2.config.listeNiveauCreature = this.createDirectOptionList(0, 35)
}
/* -------------------------------------------- */
@@ -182,13 +183,13 @@ export class MournbladeCYD2Utility {
static async preloadHandlebarsTemplates() {
const templatePaths = [
'systems/fvtt-mournblade-cyd2/templates/editor-notes-gm.hbs',
'systems/fvtt-mournblade-cyd2/templates/partial-item-header.hbs',
'systems/fvtt-mournblade-cyd2/templates/partial-item-description.hbs',
'systems/fvtt-mournblade-cyd2/templates/partial-item-nav.hbs',
'systems/fvtt-mournblade-cyd2/templates/partial-item-prix.hbs',
'systems/fvtt-mournblade-cyd2/templates/partial-automation.hbs',
'systems/fvtt-mournblade-cyd2/templates/hud-adversites.hbs',
'systems/fvtt-mournblade-cyd-2-0/templates/editor-notes-gm.hbs',
'systems/fvtt-mournblade-cyd-2-0/templates/partial-item-header.hbs',
'systems/fvtt-mournblade-cyd-2-0/templates/partial-item-description.hbs',
'systems/fvtt-mournblade-cyd-2-0/templates/partial-item-nav.hbs',
'systems/fvtt-mournblade-cyd-2-0/templates/partial-item-prix.hbs',
'systems/fvtt-mournblade-cyd-2-0/templates/partial-automation.hbs',
'systems/fvtt-mournblade-cyd-2-0/templates/hud-adversites.hbs',
]
return foundry.applications.handlebars.loadTemplates(templatePaths);
}
@@ -372,7 +373,7 @@ export class MournbladeCYD2Utility {
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
defender.changeEtatCombativite(value)
} else {
game.socket.emit("system.fvtt-mournblade-cyd2", { msg: "msg_apply_combativite", data: { defenderTokenId: rollData.defenderTokenId, value } });
game.socket.emit("system.fvtt-mournblade-cyd-2-0", { msg: "msg_apply_combativite", data: { defenderTokenId: rollData.defenderTokenId, value } });
}
}
/* -------------------------------------------- */
@@ -383,7 +384,7 @@ export class MournbladeCYD2Utility {
rollData.attrKey = "adr"
}
if (!rollData.attr) {
rollData.actionImg = "systems/fvtt-mournblade-cyd2/assets/icons/" + actor.system.attributs[rollData.attrKey].labelnorm + ".webp"
rollData.actionImg = "systems/fvtt-mournblade-cyd-2-0/assets/icons/" + actor.system.attributs[rollData.attrKey].labelnorm + ".webp"
rollData.attr = foundry.utils.duplicate(actor.system.attributs[rollData.attrKey])
}
if (rollData.attrKey2 != "none") {
@@ -503,7 +504,7 @@ export class MournbladeCYD2Utility {
}
this.createChatWithRollMode(rollData.alias, {
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade-cyd2/templates/chat-generic-result.hbs`, rollData)
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade-cyd-2-0/templates/chat-generic-result.hbs`, rollData)
}, rollData)
if ((rollData.coupBas || rollData.arme) && rollData.isSuccess && rollData.defenderTokenId) {
@@ -610,7 +611,7 @@ export class MournbladeCYD2Utility {
this.computeResultQuality(rollData)
this.createChatWithRollMode(rollData.alias, {
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade-cyd2/templates/chat-generic-result.hbs`, rollData)
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-mournblade-cyd-2-0/templates/chat-generic-result.hbs`, rollData)
}, rollData)
}
@@ -641,7 +642,7 @@ export class MournbladeCYD2Utility {
chatGM.whisper = this.getUsers(user => user.isGM);
chatGM.content = "Blinde message of " + game.user.name + "<br>" + chatOptions.content;
console.log("blindMessageToGM", chatGM);
game.socket.emit("system.fvtt-mournblade-cyd2", { msg: "msg_gm_chat_message", data: chatGM });
game.socket.emit("system.fvtt-mournblade-cyd-2-0", { msg: "msg_gm_chat_message", data: chatGM });
}
/* -------------------------------------------- */