Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0aba87a9de | |||
| 0cb764f1f3 |
@@ -482,19 +482,23 @@ table {
|
|||||||
color: rgba(0, 0, 0, 0.9);
|
color: rgba(0, 0, 0, 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor {
|
.application.sheet .editor,
|
||||||
|
.window-app.sheet .editor {
|
||||||
border: 2;
|
border: 2;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
|
margin-top: 8px;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.medium-editor {
|
.application.sheet .medium-editor,
|
||||||
|
.window-app.sheet .medium-editor {
|
||||||
border: 2;
|
border: 2;
|
||||||
height: 240px;
|
height: 240px;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.small-editor {
|
.application.sheet .small-editor,
|
||||||
|
.window-app.sheet .small-editor {
|
||||||
border: 2;
|
border: 2;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
|
|||||||
+54
-41
@@ -148,26 +148,32 @@ export class HawkmoonActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getSkills() {
|
getSkills() {
|
||||||
let comp = []
|
// Utiliser filter et map pour éviter les duplications inutiles
|
||||||
for (let item of this.items) {
|
const comp = this.items
|
||||||
item = foundry.utils.duplicate(item)
|
.filter(item => item.type === "competence")
|
||||||
if (item.type == "competence") {
|
.map(item => {
|
||||||
item.system.attribut1total = item.system.niveau + (this.system.attributs[item.system.attribut1]?.value || 0)
|
const itemCopy = foundry.utils.duplicate(item);
|
||||||
item.system.attribut2total = item.system.niveau + (this.system.attributs[item.system.attribut2]?.value || 0)
|
const attrs = this.system.attributs;
|
||||||
item.system.attribut3total = item.system.niveau + (this.system.attributs[item.system.attribut3]?.value || 0)
|
|
||||||
if (item.system.niveau == 0) {
|
itemCopy.system.attribut1total = itemCopy.system.niveau + (attrs[itemCopy.system.attribut1]?.value || 0);
|
||||||
item.system.attribut1total -= 3
|
itemCopy.system.attribut2total = itemCopy.system.niveau + (attrs[itemCopy.system.attribut2]?.value || 0);
|
||||||
item.system.attribut2total -= 3
|
itemCopy.system.attribut3total = itemCopy.system.niveau + (attrs[itemCopy.system.attribut3]?.value || 0);
|
||||||
item.system.attribut3total -= 3
|
|
||||||
|
if (itemCopy.system.niveau === 0) {
|
||||||
|
itemCopy.system.attribut1total -= 3;
|
||||||
|
itemCopy.system.attribut2total -= 3;
|
||||||
|
itemCopy.system.attribut3total -= 3;
|
||||||
}
|
}
|
||||||
item.system.attribut1label = this.system.attributs[item.system.attribut1]?.label || ""
|
|
||||||
item.system.attribut2label = this.system.attributs[item.system.attribut2]?.label || ""
|
itemCopy.system.attribut1label = attrs[itemCopy.system.attribut1]?.label || "";
|
||||||
item.system.attribut3label = this.system.attributs[item.system.attribut3]?.label || ""
|
itemCopy.system.attribut2label = attrs[itemCopy.system.attribut2]?.label || "";
|
||||||
comp.push(item)
|
itemCopy.system.attribut3label = attrs[itemCopy.system.attribut3]?.label || "";
|
||||||
}
|
|
||||||
}
|
return itemCopy;
|
||||||
HawkmoonUtility.sortArrayObjectsByName(comp)
|
});
|
||||||
return comp
|
|
||||||
|
HawkmoonUtility.sortArrayObjectsByName(comp);
|
||||||
|
return comp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------- --------------------- */
|
/* ----------------------- --------------------- */
|
||||||
@@ -745,41 +751,48 @@ export class HawkmoonActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollArmeDegats(armeId, targetVigueur = undefined, rollDataInput = undefined) {
|
async rollArmeDegats(armeId, targetVigueur = undefined, rollDataInput = undefined) {
|
||||||
let arme = this.items.get(armeId)
|
const arme = this.items.get(armeId);
|
||||||
if (!arme.system.equipped) {
|
if (!arme) {
|
||||||
ui.notifications.warn("Cette arme doit être équipée pour pouvoir infliger des dégâts !")
|
ui.notifications.warn("Arme non trouvée !");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if (arme.type == "arme") {
|
|
||||||
arme = this.prepareArme(arme)
|
if (!arme.system?.equipped) {
|
||||||
|
ui.notifications.warn("Cette arme doit être équipée pour pouvoir infliger des dégâts !");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
console.log("DEGATS", arme, targetVigueur, rollDataInput)
|
|
||||||
let roll
|
const preparedArme = arme.type === "arme" ? this.prepareArme(arme) : arme;
|
||||||
let bonus = 0
|
console.log("DEGATS", preparedArme, targetVigueur, rollDataInput);
|
||||||
let bonus2 = 0
|
|
||||||
|
let roll;
|
||||||
|
let bonus = 0;
|
||||||
|
let bonus2 = 0;
|
||||||
|
|
||||||
if (rollDataInput?.applyCoupDevastateur) {
|
if (rollDataInput?.applyCoupDevastateur) {
|
||||||
bonus2 = Math.floor(this.system.attributs.pui.value / 2)
|
bonus2 = Math.floor(this.system.attributs.pui.value / 2);
|
||||||
let talent = this.items.find(item => item.type == "talent" && item.name.toLowerCase() == "coup dévastateur")
|
const talent = this.items.find(item => item.type === "talent" && item.name.toLowerCase() === "coup dévastateur");
|
||||||
this.updateEmbeddedDocuments('Item', [{ _id: talent.id, 'system.used': true }])
|
if (talent) {
|
||||||
|
await this.updateEmbeddedDocuments('Item', [{ _id: talent.id, 'system.used': true }]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rollDataInput?.isHeroique) {
|
if (rollDataInput?.isHeroique) {
|
||||||
if (rollDataInput?.attaqueCharge) {
|
if (rollDataInput?.attaqueCharge) {
|
||||||
bonus = 5
|
bonus = 5;
|
||||||
}
|
}
|
||||||
if (rollDataInput?.chargeCavalerie) {
|
if (rollDataInput?.chargeCavalerie) {
|
||||||
bonus = 6
|
bonus = 6;
|
||||||
}
|
}
|
||||||
roll = await new Roll("2d10rr10+" + arme.system.totalDegats + "+" + bonus + "+" + bonus2).roll()
|
roll = await new Roll("2d10rr10+" + preparedArme.system.totalDegats + "+" + bonus + "+" + bonus2).roll();
|
||||||
} else {
|
} else {
|
||||||
if (rollDataInput?.attaqueCharge) {
|
if (rollDataInput?.attaqueCharge) {
|
||||||
bonus = 3
|
bonus = 3;
|
||||||
}
|
}
|
||||||
if (rollDataInput?.chargeCavalerie) {
|
if (rollDataInput?.chargeCavalerie) {
|
||||||
bonus = 4
|
bonus = 4;
|
||||||
}
|
}
|
||||||
roll = await new Roll("1d10+" + arme.system.totalDegats + "+" + bonus + "+" + bonus2).roll()
|
roll = await new Roll("1d10+" + preparedArme.system.totalDegats + "+" + bonus + "+" + bonus2).roll();
|
||||||
}
|
}
|
||||||
await HawkmoonUtility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
|
await HawkmoonUtility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
|
||||||
let nbEtatPerdus = 0
|
let nbEtatPerdus = 0
|
||||||
@@ -788,17 +801,17 @@ export class HawkmoonActor extends Actor {
|
|||||||
}
|
}
|
||||||
//console.log(roll)
|
//console.log(roll)
|
||||||
let rollData = {
|
let rollData = {
|
||||||
arme: arme,
|
arme: preparedArme,
|
||||||
finalResult: roll.total,
|
finalResult: roll.total,
|
||||||
formula: roll.formula,
|
formula: roll.formula,
|
||||||
alias: this.name,
|
alias: this.name,
|
||||||
actorImg: this.img,
|
actorImg: this.img,
|
||||||
actorId: this.id,
|
actorId: this.id,
|
||||||
defenderTokenId: rollDataInput?.defenderTokenId,
|
defenderTokenId: rollDataInput?.defenderTokenId,
|
||||||
actionImg: arme.img,
|
actionImg: preparedArme.img,
|
||||||
targetVigueur: targetVigueur,
|
targetVigueur: targetVigueur,
|
||||||
nbEtatPerdus: nbEtatPerdus
|
nbEtatPerdus: nbEtatPerdus
|
||||||
}
|
};
|
||||||
HawkmoonUtility.createChatWithRollMode(rollData.alias, {
|
HawkmoonUtility.createChatWithRollMode(rollData.alias, {
|
||||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-hawkmoon-cyd/templates/chat-degats-result.hbs`, rollData)
|
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-hawkmoon-cyd/templates/chat-degats-result.hbs`, rollData)
|
||||||
})
|
})
|
||||||
|
|||||||
+29
-11
@@ -106,8 +106,17 @@ export class HawkmoonUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static updatePauseLogo(html) {
|
static updatePauseLogo(html) {
|
||||||
let logoPause = "systems/fvtt-hawkmoon-cyd/assets/logos/" + game.settings.get("fvtt-hawkmoon-cyd", "hawkmoon-pause-logo") + ".webp"
|
const validLogos = ["hawkmoon_logo", "logo_pause_resistance", "logo_pause_hawkmoon_stone", "logo_pause_hawkmoon_violet", "logo_pause_hawkmoon_beige", "logo_pause_hawkmoon_rouge"];
|
||||||
console.log("Hawkmoon | Updating pause logo to:", logoPause)
|
let logoName = game.settings.get("fvtt-hawkmoon-cyd", "hawkmoon-pause-logo");
|
||||||
|
|
||||||
|
// Validation du nom du logo
|
||||||
|
if (!validLogos.includes(logoName)) {
|
||||||
|
console.error("Hawkmoon | Invalid logo name:", logoName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let logoPause = "systems/fvtt-hawkmoon-cyd/assets/logos/" + logoName + ".webp";
|
||||||
|
console.log("Hawkmoon | Updating pause logo to:", logoPause);
|
||||||
|
|
||||||
// Supprimer l'ancien style s'il existe
|
// Supprimer l'ancien style s'il existe
|
||||||
let oldStyle = document.getElementById('hawkmoon-pause-logo-override')
|
let oldStyle = document.getElementById('hawkmoon-pause-logo-override')
|
||||||
@@ -138,13 +147,6 @@ export class HawkmoonUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static createDirectOptionList(min, max) {
|
|
||||||
let options = {};
|
|
||||||
for (let i = min; i <= max; i++) {
|
|
||||||
options[`${i}`] = `${i}`;
|
|
||||||
}
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
static createArrayOptionList(min, max) {
|
static createArrayOptionList(min, max) {
|
||||||
let options = [];
|
let options = [];
|
||||||
for (let i = min; i <= max; i++) {
|
for (let i = min; i <= max; i++) {
|
||||||
@@ -161,8 +163,19 @@ export class HawkmoonUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async loadCompendium(compendium, filter = item => true) {
|
static async loadCompendium(compendium, filter = item => true) {
|
||||||
let compendiumData = await HawkmoonUtility.loadCompendiumData(compendium);
|
const pack = game.packs.get(compendium);
|
||||||
|
if (!pack) {
|
||||||
|
console.warn(`Hawkmoon | Compendium not found: ${compendium}`);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const compendiumData = await pack.getDocuments();
|
||||||
return compendiumData.filter(filter);
|
return compendiumData.filter(filter);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Hawkmoon | Error loading compendium ${compendium}:`, error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -366,6 +379,12 @@ export class HawkmoonUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static computeResult(rollData) {
|
static computeResult(rollData) {
|
||||||
|
// Validation des données de roll
|
||||||
|
if (!rollData.roll?.terms?.[0]?.results?.[0]?.result) {
|
||||||
|
console.error("Hawkmoon | Invalid roll data:", rollData);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rollData.diceResult = rollData.roll.terms[0].results[0].result
|
rollData.diceResult = rollData.roll.terms[0].results[0].result
|
||||||
if (rollData.mainDice.includes("d20")) {
|
if (rollData.mainDice.includes("d20")) {
|
||||||
let diceValue = rollData.roll.terms[0].results[0].result
|
let diceValue = rollData.roll.terms[0].results[0].result
|
||||||
@@ -379,7 +398,6 @@ export class HawkmoonUtility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log("Result : ", rollData
|
|
||||||
this.computeResultQuality(rollData)
|
this.computeResultQuality(rollData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
MANIFEST-000427
|
MANIFEST-000439
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
2026/04/01-23:48:22.946320 7fe6ad3fe6c0 Recovering log #425
|
2026/05/06-18:00:14.573290 7fd32a7ed6c0 Recovering log #438
|
||||||
2026/04/01-23:48:22.956435 7fe6ad3fe6c0 Delete type=3 #423
|
2026/05/06-18:00:14.583030 7fd32a7ed6c0 Delete type=0 #438
|
||||||
2026/04/01-23:48:22.956489 7fe6ad3fe6c0 Delete type=0 #425
|
2026/05/06-18:00:14.583082 7fd32a7ed6c0 Delete type=3 #437
|
||||||
2026/04/01-23:48:49.994348 7fe6977fe6c0 Level-0 table #430: started
|
|
||||||
2026/04/01-23:48:49.994365 7fe6977fe6c0 Level-0 table #430: 0 bytes OK
|
|
||||||
2026/04/01-23:48:50.000517 7fe6977fe6c0 Delete type=0 #428
|
|
||||||
2026/04/01-23:48:50.021367 7fe6977fe6c0 Manual compaction at level-0 from '!journal!MUbViCE2PkVxlzqe' @ 72057594037927935 : 1 .. '!journal.pages!gVybbv17TFY8o3Y4.fQidyqfF1TbsZKHM' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
2026/04/01-23:46:40.702487 7fe6ad3fe6c0 Recovering log #420
|
2026/05/06-17:43:45.593194 7f13097ed6c0 Recovering log #436
|
||||||
2026/04/01-23:46:40.761328 7fe6ad3fe6c0 Delete type=3 #418
|
2026/05/06-17:43:45.603829 7f13097ed6c0 Delete type=0 #436
|
||||||
2026/04/01-23:46:40.761414 7fe6ad3fe6c0 Delete type=0 #420
|
2026/05/06-17:43:45.603909 7f13097ed6c0 Delete type=3 #435
|
||||||
2026/04/01-23:48:06.570346 7fe6977fe6c0 Level-0 table #426: started
|
|
||||||
2026/04/01-23:48:06.570403 7fe6977fe6c0 Level-0 table #426: 0 bytes OK
|
|
||||||
2026/04/01-23:48:06.576732 7fe6977fe6c0 Delete type=0 #424
|
|
||||||
2026/04/01-23:48:06.601089 7fe6977fe6c0 Manual compaction at level-0 from '!journal!MUbViCE2PkVxlzqe' @ 72057594037927935 : 1 .. '!journal.pages!gVybbv17TFY8o3Y4.fQidyqfF1TbsZKHM' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
|||||||
MANIFEST-000426
|
MANIFEST-000434
|
||||||
|
|||||||
+3
-7
@@ -1,7 +1,3 @@
|
|||||||
2026/04/01-23:48:22.846060 7fe6acbfd6c0 Recovering log #424
|
2026/05/02-22:53:14.438750 7f09889fd6c0 Recovering log #433
|
||||||
2026/04/01-23:48:22.856276 7fe6acbfd6c0 Delete type=3 #422
|
2026/05/02-22:53:14.491497 7f09889fd6c0 Delete type=0 #433
|
||||||
2026/04/01-23:48:22.856340 7fe6acbfd6c0 Delete type=0 #424
|
2026/05/02-22:53:14.491560 7f09889fd6c0 Delete type=3 #432
|
||||||
2026/04/01-23:48:49.941313 7fe6977fe6c0 Level-0 table #429: started
|
|
||||||
2026/04/01-23:48:49.941337 7fe6977fe6c0 Level-0 table #429: 0 bytes OK
|
|
||||||
2026/04/01-23:48:49.947373 7fe6977fe6c0 Delete type=0 #427
|
|
||||||
2026/04/01-23:48:49.967196 7fe6977fe6c0 Manual compaction at level-0 from '!items!0fit7HelSjaFtXcW' @ 72057594037927935 : 1 .. '!items!wxrzP3NyiHiYnAMJ' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
+3
-7
@@ -1,7 +1,3 @@
|
|||||||
2026/04/01-23:46:40.215373 7fe697fff6c0 Recovering log #419
|
2026/05/02-22:52:57.748488 7fe282bfe6c0 Recovering log #431
|
||||||
2026/04/01-23:46:40.273392 7fe697fff6c0 Delete type=3 #417
|
2026/05/02-22:52:57.803792 7fe282bfe6c0 Delete type=0 #431
|
||||||
2026/04/01-23:46:40.273479 7fe697fff6c0 Delete type=0 #419
|
2026/05/02-22:52:57.803902 7fe282bfe6c0 Delete type=3 #430
|
||||||
2026/04/01-23:48:06.532308 7fe6977fe6c0 Level-0 table #425: started
|
|
||||||
2026/04/01-23:48:06.532350 7fe6977fe6c0 Level-0 table #425: 0 bytes OK
|
|
||||||
2026/04/01-23:48:06.538189 7fe6977fe6c0 Delete type=0 #423
|
|
||||||
2026/04/01-23:48:06.544356 7fe6977fe6c0 Manual compaction at level-0 from '!items!0fit7HelSjaFtXcW' @ 72057594037927935 : 1 .. '!items!wxrzP3NyiHiYnAMJ' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7
-3
@@ -408,17 +408,21 @@ table {
|
|||||||
.fvtt-hawkmoon-cyd .sheet-body select {
|
.fvtt-hawkmoon-cyd .sheet-body select {
|
||||||
color: rgba(0, 0, 0, 0.9);
|
color: rgba(0, 0, 0, 0.9);
|
||||||
}
|
}
|
||||||
.editor {
|
.application.sheet .editor,
|
||||||
|
.window-app.sheet .editor {
|
||||||
border: 2;
|
border: 2;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
|
margin-top: 8px;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
}
|
}
|
||||||
.medium-editor {
|
.application.sheet .medium-editor,
|
||||||
|
.window-app.sheet .medium-editor {
|
||||||
border: 2;
|
border: 2;
|
||||||
height: 240px;
|
height: 240px;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
}
|
}
|
||||||
.small-editor {
|
.application.sheet .small-editor,
|
||||||
|
.window-app.sheet .small-editor {
|
||||||
border: 2;
|
border: 2;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user