diff --git a/assets/fonts/broadw.ttf b/assets/fonts/broadw.ttf
new file mode 100644
index 0000000..62aeb1e
Binary files /dev/null and b/assets/fonts/broadw.ttf differ
diff --git a/assets/fonts/broadway.woff2 b/assets/fonts/broadway.woff2
new file mode 100644
index 0000000..9d4b045
Binary files /dev/null and b/assets/fonts/broadway.woff2 differ
diff --git a/css/fvtt-cthulhu-eternal.css b/css/fvtt-cthulhu-eternal.css
index fbfc0f7..1113354 100644
--- a/css/fvtt-cthulhu-eternal.css
+++ b/css/fvtt-cthulhu-eternal.css
@@ -1,10 +1,39 @@
+@font-face {
+ font-family: "Georama";
+ src: url("../assets/fonts/georama.woff2") format("woff2");
+}
+@font-face {
+ font-family: "Broadway";
+ src: url("../assets/fonts/broadway.woff2") format("woff2");
+}
+@font-face {
+ font-family: "Caslon";
+ src: url("../fonts/caslonpro-regular.otf") format("truetype");
+}
+@font-face {
+ font-family: "Caslon Bold";
+ src: url("../fonts/caslonpro-bold.otf") format("truetype");
+}
+@font-face {
+ font-family: "Caslon Bold Italic";
+ src: url("../fonts/caslonpro-bolditalic.otf") format("truetype");
+}
+@font-face {
+ font-family: "Caslon Italic";
+ src: url("../fonts/caslonpro-italic.otf") format("truetype");
+}
:root {
--font-size-standard: 0.9rem;
--background-image-base: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url("../assets/ui/jazzage_background_main.webp");
/*--background-image-base: url("../assets/ui/jazzage_background_main.webp");*/
--font-primary: "Georama";
--font-secondary: "Georama";
+ --font-title: "Broadway";
--logo-standard: url("../assets/logos/reanimated-ce-logo.webp");
+ --color-success: darkgreen;
+ --color-failure: darkred;
+ --color-critical-success: lightgreen;
+ --color-critical-failure: lightcoral;
}
.era-icon-color {
/*filter: invert(90%) sepia(10%) saturate(1215%) hue-rotate(55deg) brightness(93%) contrast(89%);*/
@@ -50,7 +79,8 @@ i.fvtt-cthulhu-eternal {
.chat-message.whisper {
font-family: var(--font-primary);
background-image: var(--background-image-base);
- background-repeat: no-repeat;
+ background-repeat: repeat-y;
+ background-position: 0%;
background-size: 100% 100%;
}
.fvtt-cthulhu-eternal .protagonist-sheet-common label {
@@ -179,6 +209,8 @@ i.fvtt-cthulhu-eternal {
display: flex;
}
.fvtt-cthulhu-eternal .protagonist-main .protagonist-pc .protagonist-right .protagonist-name input {
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.4);
width: 400px;
}
.fvtt-cthulhu-eternal .protagonist-main .protagonist-pc .protagonist-right .protagonist-infos {
@@ -1285,6 +1317,38 @@ i.fvtt-cthulhu-eternal {
display: flex;
flex-direction: column;
}
+.dice-roll .intro-chat .intro-right ul {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+ justify-content: center;
+ align-items: center;
+}
+.dice-roll .intro-chat .intro-right ul li {
+ margin: 0 10px;
+ font-family: var(--font-primary);
+ font-size: calc(var(--font-size-standard) * 1);
+}
+.dice-roll .intro-chat .intro-right ul .result-success {
+ color: var(--color-success);
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.2);
+}
+.dice-roll .intro-chat .intro-right ul .result-critical-success {
+ color: var(--color-critical-success);
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.2);
+}
+.dice-roll .intro-chat .intro-right ul .result-failure {
+ color: var(--color-failure);
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.2);
+}
+.dice-roll .intro-chat .intro-right ul .result-critical-failure {
+ color: var(--color-critical-failure);
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.2);
+}
.dice-roll .intro-chat .intro-right .introText {
font-family: var(--font-secondary);
font-size: calc(var(--font-size-standard) * 1.2);
diff --git a/gulpfile.js b/gulpfile.js
index 6f1cbf4..39dbdfb 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -29,3 +29,4 @@ exports.default = gulp.series(
watchUpdates
);
exports.css = css;
+exports.watchUpdates = watchUpdates;
diff --git a/lang/en.json b/lang/en.json
index 2bf0eb4..49ecfba 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -250,7 +250,13 @@
"breakingPoint": "Breaking Point",
"willpower": "Willpower",
"totalScore": "Total Score",
- "exhausted": "Exhausted"
+ "exhausted": "Exhausted",
+ "skillRoll": "Skill Roll",
+ "finalScore": "Final Score",
+ "failure": "Failure",
+ "success": "Success",
+ "criticalSuccess": "Critical Success",
+ "criticalFailure": "Critical Failure"
},
"Edit": "Edit",
"Delete": "Delete",
diff --git a/module/applications/sheets/protagonist-sheet.mjs b/module/applications/sheets/protagonist-sheet.mjs
index 062fb49..5b00abf 100644
--- a/module/applications/sheets/protagonist-sheet.mjs
+++ b/module/applications/sheets/protagonist-sheet.mjs
@@ -5,7 +5,7 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
static DEFAULT_OPTIONS = {
classes: ["protagonist"],
position: {
- width: 820,
+ width: 840,
height: 620,
},
window: {
diff --git a/module/documents/roll.mjs b/module/documents/roll.mjs
index e889b56..bec6669 100644
--- a/module/documents/roll.mjs
+++ b/module/documents/roll.mjs
@@ -34,14 +34,6 @@ export default class CthulhuEternalRoll extends Roll {
return this.options.actorImage
}
- get introText() {
- return this.options.introText
- }
-
- get introTextTooltip() {
- return this.options.introTextTooltip
- }
-
get help() {
return this.options.help
}
@@ -82,37 +74,6 @@ export default class CthulhuEternalRoll extends Roll {
return this.options.realDamage
}
- /**
- * Generates introductory text based on the roll type.
- *
- * @returns {string} The formatted introductory text for the roll.
- */
- _createIntroText() {
- let text
-
- switch (this.type) {
- case "skill":
- const skillLabel = game.i18n.localize(`CTHULHUETERNAL.Character.FIELDS.caracteristiques.${this.target}.valeur.label`)
- text = game.i18n.format("CTHULHUETERNAL.Roll.skill", { skill: "skill" })
- text = text.concat("
").concat(`Seuil : ${this.treshold}`)
- break
- }
- return text
- }
-
- /**
- * Generates an introductory text tooltip with characteristics and modifiers.
- *
- * @returns {string} A formatted string containing the value, help, hindrance, and modifier.
- */
- _createIntroTextTooltip() {
- let tooltip = game.i18n.format("CTHULHUETERNAL.Tooltip.saveIntroTextTooltip", { value: this.value, help: this.help, gene: this.gene, modifier: this.modifier })
- if (this.hasTarget) {
- tooltip = tooltip.concat(`
Target : ${this.targetName}`)
- }
- return tooltip
- }
-
/**
* Prompt the user with a dialog to configure and execute a roll.
*
@@ -132,13 +93,13 @@ export default class CthulhuEternalRoll extends Roll {
switch (options.rollType) {
case "skill":
console.log(options.rollItem)
- options.targetScore = options.rollItem.system.computeScore()
+ options.initialScore = options.rollItem.system.computeScore()
break
case "characteristic":
- options.targetScore = options.rollItem.value * 5
+ options.initialScore = options.rollItem.value * 5
break
default:
- options.targetScore = 50
+ options.initialScore = 50
break
}
@@ -167,7 +128,8 @@ export default class CthulhuEternalRoll extends Roll {
let dialogContext = {
rollType: options.rollType,
rollItem: foundry.utils.duplicate(options.rollItem), // Object only, no class
- targetScore: options.targetScore,
+ initialScore: options.initialScore,
+ targetScore: options.initialScore,
rollModes,
fieldRollMode,
choiceModifier,
@@ -213,6 +175,7 @@ export default class CthulhuEternalRoll extends Roll {
actorImage: options.actorImage,
rollMode: rollContext.visibility,
hasTarget: options.hasTarget,
+ initialScore: options.initialScore,
targetName,
targetArmor,
targetMalus,
@@ -220,7 +183,7 @@ export default class CthulhuEternalRoll extends Roll {
}
// Update target score
- rollData.targetScore = options.targetScore + Number(rollData.modifier)
+ rollData.targetScore = Math.min( Math.max(options.initialScore + Number(rollData.modifier), 0), 100)
/**
* A hook event that fires before the roll is made.
@@ -230,14 +193,27 @@ export default class CthulhuEternalRoll extends Roll {
const roll = new this(formula, options.data, rollData)
await roll.evaluate()
- let resultType = "failure"
+ // Compute the result quality
+ let resultType = "failure"
+ let dec = Math.floor(roll.total/10)
+ let unit = roll.total - (dec*10)
if (roll.total <= rollData.targetScore) {
resultType = "success"
+ // Detect if decimal == unit in the dire total result
+ if (dec === unit || roll.total == 1) {
+ resultType = "successCritical"
+ }
+ } else {
+ // Detect if decimal == unit in the dire total result
+ if (dec === unit || roll.total == 100) {
+ resultType = "failureCritical"
+ }
}
roll.options.resultType = resultType
- roll.options.introText = roll._createIntroText()
- roll.options.introTextTooltip = roll._createIntroTextTooltip()
+ roll.options.isSuccess = resultType === "success" || resultType === "successCritical"
+ roll.options.isFailure = resultType === "failure" || resultType === "failureCritical"
+ roll.options.isCritical = resultType === "successCritical" || resultType === "failureCritical"
/**
* A hook event that fires after the roll has been made.
@@ -284,8 +260,6 @@ export default class CthulhuEternalRoll extends Roll {
* @property {string} actorId - The ID of the actor performing the roll.
* @property {string} actingCharName - The name of the character performing the roll.
* @property {string} actingCharImg - The image of the character performing the roll.
- * @property {string} introText - Introductory text for the roll.
- * @property {string} introTextTooltip - Tooltip for the introductory text.
* @property {string} resultType - The type of result (e.g., success, failure).
* @property {boolean} hasTarget - Indicates if the roll has a target.
* @property {string} targetName - The name of the target.
@@ -302,16 +276,18 @@ export default class CthulhuEternalRoll extends Roll {
diceTotal: this.dice.reduce((t, d) => t + d.total, 0),
isGM: game.user.isGM,
rollItem: this.options.rollItem,
+ initialScore: this.options.initialScore,
targetScore: this.options.targetScore,
rollType: this.options.rollType,
+ modifier: this.options.modifier,
formula: this.formula,
total: this.total,
- isFailure: this.isFailure,
+ isSuccess: this.options.isSuccess,
+ isFailure: this.options.isFailure,
+ isCritical: this.options.isCritical,
actorId: this.actorId,
actingCharName: this.actorName,
actingCharImg: this.actorImage,
- introText: this.introText,
- introTextTooltip: this.introTextTooltip,
resultType: this.resultType,
hasTarget: this.hasTarget,
targetName: this.targetName,
@@ -338,8 +314,6 @@ export default class CthulhuEternalRoll extends Roll {
super.toMessage(
{
isFailure: this.resultType === "failure",
- introText: this.introText,
- introTextTooltip: this.introTextTooltip,
actingCharName: this.actorName,
actingCharImg: this.actorImage,
hasTarget: this.hasTarget,
diff --git a/styles/fonts.less b/styles/fonts.less
index cd35c40..314ef66 100644
--- a/styles/fonts.less
+++ b/styles/fonts.less
@@ -3,6 +3,11 @@
src: url("../assets/fonts/georama.woff2") format("woff2");
}
+@font-face {
+ font-family: "Broadway";
+ src: url("../assets/fonts/broadway.woff2") format("woff2");
+}
+
@font-face {
font-family: "Caslon";
src: url("../fonts/caslonpro-regular.otf") format("truetype");
diff --git a/styles/fvtt-cthulhu-eternal.less b/styles/fvtt-cthulhu-eternal.less
index 9b7fec2..eb5b283 100644
--- a/styles/fvtt-cthulhu-eternal.less
+++ b/styles/fvtt-cthulhu-eternal.less
@@ -1,3 +1,4 @@
+@import "fonts.less";
@import "global.less";
.fvtt-cthulhu-eternal {
diff --git a/styles/global.less b/styles/global.less
index f41f4e4..ce6a3eb 100644
--- a/styles/global.less
+++ b/styles/global.less
@@ -5,7 +5,12 @@
/*--background-image-base: url("../assets/ui/jazzage_background_main.webp");*/
--font-primary: "Georama";
--font-secondary: "Georama";
+ --font-title: "Broadway";
--logo-standard: url("../assets/logos/reanimated-ce-logo.webp");
+ --color-success: darkgreen;
+ --color-failure: darkred;
+ --color-critical-success: lightgreen;
+ --color-critical-failure: lightcoral;
}
.era-icon-color {
@@ -57,6 +62,7 @@ i.fvtt-cthulhu-eternal {
.chat-message.whisper {
font-family: var(--font-primary);
background-image: var(--background-image-base);
- background-repeat: no-repeat;
+ background-repeat:repeat-y;
+ background-position: 0%;
background-size: 100% 100%;
}
diff --git a/styles/protagonist.less b/styles/protagonist.less
index d4a26c6..8ed9c21 100644
--- a/styles/protagonist.less
+++ b/styles/protagonist.less
@@ -62,6 +62,8 @@
.protagonist-name {
display: flex;
input {
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.4);
width: 400px;
}
}
diff --git a/styles/roll.less b/styles/roll.less
index 01ce4d8..20e738d 100644
--- a/styles/roll.less
+++ b/styles/roll.less
@@ -75,6 +75,38 @@
.intro-right {
display: flex;
flex-direction: column;
+ ul {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+ justify-content: center;
+ align-items: center;
+ li {
+ margin: 0 10px;
+ font-family: var(--font-primary);
+ font-size: calc(var(--font-size-standard) * 1.0);
+ }
+ .result-success {
+ color: var(--color-success);
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.2);
+ }
+ .result-critical-success {
+ color: var(--color-critical-success);
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.2);
+ }
+ .result-failure {
+ color: var(--color-failure);
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.2);
+ }
+ .result-critical-failure {
+ color: var(--color-critical-failure);
+ font-family: var(--font-title);
+ font-size: calc(var(--font-size-standard) * 1.2);
+ }
+ }
.introText {
font-family: var(--font-secondary);
font-size: calc(var(--font-size-standard) * 1.2);
diff --git a/templates/chat-message.hbs b/templates/chat-message.hbs
index 7816ea0..b516b1d 100644
--- a/templates/chat-message.hbs
+++ b/templates/chat-message.hbs
@@ -4,19 +4,34 @@
{{{introText}}} - {{#if (eq rollType "skill")}} - {{rollItem.name}} : {{targetScore}} - Modifier : {{modifier}} - {{/if}} -
+