Compare commits

...

17 Commits

Author SHA1 Message Date
Vlyan
e54a105222 Release v1.13.1 - Conditions & Fixes 2025-09-21 16:55:57 +02:00
Vlyan
bee911df5e Merge branch 'dev' into 'dev'
apply incapacitated if character's fatigue goes beyond endurance, simplify...

See merge request teaml5r/l5r5e!46
2025-09-11 15:35:03 +00:00
Bernhard Posselt
e2e533d481 apply incapacitated if character's fatigue goes beyond endurance, simplify update logic since composure and endurance are derived attributes which aren't persisted on the actor's data 2025-09-06 11:14:13 +02:00
Vlyan
2518ded84f only add l5r conditions instead of replacing them all 2025-09-06 09:48:02 +02:00
Vlyan
fab88401ea Merge branch 'dev' into 'dev'
Automatically add compromised condition when strife goes beyond max and remove...

See merge request teaml5r/l5r5e!45
2025-09-06 07:38:11 +00:00
Putty
7fed2f0a98 Automatically add compromised condition when strife goes beyond max and remove... 2025-09-06 07:38:10 +00:00
Vlyan
7c3ef81dec updated conditions on types 2025-09-05 10:45:09 +02:00
Vlyan
cbb52bf3aa Merge branch 'automated-exhausted-condition' into 'dev'
Automated exhausted condition

See merge request teaml5r/l5r5e!44
2025-09-05 08:34:20 +00:00
Putty
86f73a96d0 Automated exhausted condition 2025-09-05 08:34:20 +00:00
Vlyan
dbba39373b basic tooltip fix by KitCat #62 2025-09-05 10:20:55 +02:00
Vlyan
30455759e8 Properties loading optimizations by KitCat 2025-09-05 09:53:48 +02:00
Vlyan
eb675f24ea Added ability to remove condition from actor sheet + journal on click. 2025-09-04 13:18:17 +02:00
Vlyan
1357ec9b6d Merge branch 'conditions' into 'dev'
Implement token conditions

See merge request teaml5r/l5r5e!42
2025-09-04 07:53:36 +00:00
Vlyan
396986fefd Merge branch 'issue65_calling_map_on_set' into 'dev'
Fixing using map on Set causing issues. Renamed a few variables to try and...

See merge request teaml5r/l5r5e!43
2025-09-04 07:49:09 +00:00
Vlyan
c591cee153 #66 fix fade configuration css 2025-09-04 09:47:07 +02:00
Litasa
54ae4fdb63 Fixing using map on Set causing issues. Renamed a few variables to try and make it more clear what type they are 2025-09-03 20:09:39 +00:00
Bernhard Posselt
e846a0a30c implement token conditions 2025-09-03 14:11:06 +02:00
43 changed files with 558 additions and 71 deletions

View File

@@ -6,13 +6,25 @@ Date format : day/month/year
> - `foundry-version`: Stick to the major version of FoundryVTT.
> - `system-version`: System functionalities and Fixes.
## 1.13.1 - 21/09/2025 - Conditions & Fixes
- Fix for Clicking on items doesn't show item window (#65 Thx to Litasa)
- Fix for fade configuration (#66)
- Added some Tooltips loading optimizations (#62 Thanks to KitCat).
- Added some Properties loading optimizations (#63 Thanks to KitCat).
- Conditions changes :
- Added basic token conditions (Thanks to Putty)
- Added compromised condition when strife goes beyond max (Thanks to Putty).
- Added apply incapacitated if character's fatigue goes beyond endurance (Thanks to Putty).
- Added ability to remove condition from actor sheet and show core journal on click.
- Added option to show all conditions (StatusEffect), default to false (show only l5R conditions).
## 1.13.0 - 24/08/2025 - Foundry v13 Compatibility (Thx to Litasa)
__! Be certain to carefully back up any critical user data before installing this update !__
- Updated the System to FoundryVTT v13.
- Compendiums
- Added English compendium for `Children of the Five Winds`.
- Added French translation for `Writ of the Wild`.
- Fix Compendium Typo: "Beseech Hida's MIght" -> "Beseech Hida's Might" (!59).
- Fix Compendium Typo: "Beseech Hida's MIght" -> "Beseech Hida's Might" (#59).
- Actor sheets: Technique types are now hidden when they are not checked in locked mode.
- Fix 20Q: Technique message fixed (unallowed tech for School).
- Switched wysiwyg editor engine to `prosemirror` for text editor (`tinymce` will be removed in Foundry v14).
@@ -54,12 +66,12 @@ __! Be certain to carefully back up any critical user data before installing thi
## 1.11.0 - 13/12/2023 - Little fixes
- 20Q :
- Starting techniques now have a limit of 6 techniques instead of 5 (see Celestial Realms : `Moshi Sun Sentinel School`).
- Enable dropping on the 'drop here' label for 20Q (thk to Litasa !34).
- Enable dropping on the 'drop here' label for 20Q (thk to Litasa #34).
- Compendiums : Added masteries and abilities from Deathly Turns.
## 1.10.1 - 22/08/2023 - Litasa's fixes
All these changes are thanks to Litasa.
- Roll-n-Keep dialog now waits for the DiceSoNice animation to finish before displaying the result when re-rolling or exploding dice (!28).
- Roll-n-Keep dialog now waits for the DiceSoNice animation to finish before displaying the result when re-rolling or exploding dice (#28).
- Adding the ability to have a different name for the custom-compendium (needed to disable the system embedded ones).
- Fixes some CSS issues when the font size is not the default (#50, #51 and #52).
@@ -75,8 +87,8 @@ __! Be certain to carefully back up any critical user data before installing thi
## 1.9.6 - 14/05/2023 - Bragma's QoL
All these changes are thanks to Bragma.
- Added effects panel to both pc and npc (!26).
- Added a underline on rings to show current stance (!25).
- Added effects panel to both pc and npc (#26).
- Added an underline on rings to show current stance (#25).
- Fix Lists not showing correctly in journal (#44).
## 1.9.5 - 11/01/2023 - Adding Modifiers

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -21,6 +21,10 @@
"SetTn1OnTypeChange": "Set TN to 1 on encounter change",
"SetTn1OnTypeChangeHint": "Set the TN to 1 when the encounter type is selected (Intrigue, Duel, Skirmish or Mass battle)"
},
"ShowAllStatusEffects": {
"Title": "Show all StatusEffects",
"Hint": "If uncheck (default), only L5R conditions are shown."
},
"CustomTechniques": {
"Title": "Use custom techniques",
"Hint": "Add 'Specificity' technique type to serve as a catch-all."
@@ -80,6 +84,41 @@
},
"l5r5e": {
"title": "Legend of the Five Rings",
"conditions": {
"afflicted": "Afflicted",
"bleeding": "Bleeding",
"burning": "Burning",
"centered": "Centered",
"compromised": "Compromised",
"dazed": "Dazed",
"disoriented": "Disoriented",
"dying": "Dying",
"emboldened": "Emboldened",
"enraged": "Enraged",
"exhausted": "Exhausted",
"immobilized": "Immobilized",
"illness_coughing_illness": "Illness: Coughing Illness",
"illness_fire_rash": "Illness: Fire Rash",
"illness_gut_sickness": "Illness: Gut Sickness",
"illness_oozing_sore_disease": "Illness: Oozing Sore Disease",
"illness_unsteady_illness": "Illness: Unsteady Illness",
"incapacitated": "Incapacitated",
"intoxicated": "Intoxicated",
"possessed": "Possessed",
"prone": "Prone",
"silenced": "Silenced",
"unconscious": "Unconscious",
"lightly_wounded_fire": "Lightly Wounded (Fire)",
"lightly_wounded_water": "Lightly Wounded (Water)",
"lightly_wounded_air": "Lightly Wounded (Air)",
"lightly_wounded_earth": "Lightly Wounded (Earth)",
"lightly_wounded_void": "Lightly Wounded (Void)",
"severely_wounded_fire": "Severely Wounded (Fire)",
"severely_wounded_water": "Severely Wounded (Water)",
"severely_wounded_air": "Severely Wounded (Air)",
"severely_wounded_earth": "Severely Wounded (Earth)",
"severely_wounded_void": "Severely Wounded (Void)"
},
"global": {
"edge_translation_disclaimer": "",
"add": "Add",

View File

@@ -21,6 +21,10 @@
"SetTn1OnTypeChange": "Poner el NO a 1 al seleccionar el tipo de encuentro",
"SetTn1OnTypeChangeHint": "Poner el NO a 1 cuando se elige el tipo de encuentro (Intriga, Duelo, Escaramuza o Batalla a gran escala)"
},
"ShowAllStatusEffects": {
"Title": "Show all StatusEffects",
"Hint": "If uncheck (default), only L5R conditions are shown."
},
"CustomTechniques": {
"Title": "Use custom techniques",
"Hint": "Add 'Specificity' technique type to serve as a catch-all."
@@ -80,6 +84,41 @@
},
"l5r5e": {
"title": "Legend of the five Rings",
"conditions": {
"afflicted": "Afflicted",
"bleeding": "Bleeding",
"burning": "Burning",
"centered": "Centered",
"compromised": "Compromised",
"dazed": "Dazed",
"disoriented": "Disoriented",
"dying": "Dying",
"emboldened": "Emboldened",
"enraged": "Enraged",
"exhausted": "Exhausted",
"immobilized": "Immobilized",
"illness_coughing_illness": "Illness: Coughing Illness",
"illness_fire_rash": "Illness: Fire Rash",
"illness_gut_sickness": "Illness: Gut Sickness",
"illness_oozing_sore_disease": "Illness: Oozing Sore Disease",
"illness_unsteady_illness": "Illness: Unsteady Illness",
"incapacitated": "Incapacitated",
"intoxicated": "Intoxicated",
"possessed": "Possessed",
"prone": "Prone",
"silenced": "Silenced",
"unconscious": "Unconscious",
"lightly_wounded_fire": "Lightly Wounded (Fire)",
"lightly_wounded_water": "Lightly Wounded (Water)",
"lightly_wounded_air": "Lightly Wounded (Air)",
"lightly_wounded_earth": "Lightly Wounded (Earth)",
"lightly_wounded_void": "Lightly Wounded (Void)",
"severely_wounded_fire": "Severely Wounded (Fire)",
"severely_wounded_water": "Severely Wounded (Water)",
"severely_wounded_air": "Severely Wounded (Air)",
"severely_wounded_earth": "Severely Wounded (Earth)",
"severely_wounded_void": "Severely Wounded (Void)"
},
"global": {
"edge_translation_disclaimer": "Edge Studio nos da su permiso para ofrecer este módulo a la comunidad, pero tanto los textos así como los códigos que lo constituyen no tienen su aprobación explícita.",
"add": "Añadir",

View File

@@ -21,6 +21,10 @@
"SetTn1OnTypeChange": "ND 1 à la sélection du type de rencontre",
"SetTn1OnTypeChangeHint": "Met le ND à 1 lorsqu'on modifie le type de rencontre (Intrigue, Duel, Escarmouche ou Bataille rangée)"
},
"ShowAllStatusEffects": {
"Title": "Affiche tous les StatusEffects",
"Hint": "Si décoché (défaut), uniquement les conditions de L5R sont affichées."
},
"CustomTechniques": {
"Title": "Utiliser les techniques personnalisées",
"Hint": "Ajoute un type de technique 'Particularités' pour servir de fourre-tout."
@@ -79,7 +83,42 @@
}
},
"l5r5e": {
"title": "Legend of the five Rings",
"title": "La Légende des Cinq Anneaux",
"conditions": {
"afflicted": "Tourmenté",
"bleeding": "En sang",
"burning": "En feu",
"centered": "Centered",
"compromised": "Compromis",
"dazed": "Hébété",
"disoriented": "Désorienté",
"dying": "Mourant",
"emboldened": "Emboldened",
"enraged": "Enragé",
"exhausted": "Épuisé",
"immobilized": "Immobilisé",
"illness_coughing_illness": "Maladie : Mauvaise toux",
"illness_fire_rash": "Maladie : Rougeurs",
"illness_gut_sickness": "Maladie : Mal des entrailles",
"illness_oozing_sore_disease": "Maladie : Bubons purulents",
"illness_unsteady_illness": "Maladie : Vertiges",
"incapacitated": "Hors de combat",
"intoxicated": "Ivre",
"possessed": "Possédé",
"prone": "A terre",
"silenced": "Aphone",
"unconscious": "Inconscient",
"lightly_wounded_fire": "Légèrement Blessé (Feu)",
"lightly_wounded_water": "Légèrement Blessé (Eau)",
"lightly_wounded_air": "Légèrement Blessé (Air)",
"lightly_wounded_earth": "Légèrement Blessé (Terre)",
"lightly_wounded_void": "Légèrement Blessé (Vide)",
"severely_wounded_fire": "Gravement blessé (Feu)",
"severely_wounded_water": "Gravement blessé (Eau)",
"severely_wounded_air": "Gravement blessé (Air)",
"severely_wounded_earth": "Gravement blessé (Terre)",
"severely_wounded_void": "Gravement blessé (Vide)"
},
"global": {
"edge_translation_disclaimer": "",
"add": "Ajouter",

View File

@@ -21,6 +21,10 @@
"SetTn1OnTypeChange": "Fissa la TN a 1 quando si cambia il conflitto",
"SetTn1OnTypeChangeHint": "Fissa la TN a 1 quando si seleziona il tipo di conflitto (Intrigo, Duello, Schermaglia or Battaglia campale)"
},
"ShowAllStatusEffects": {
"Title": "Show all StatusEffects",
"Hint": "If uncheck (default), only L5R conditions are shown."
},
"CustomTechniques": {
"Title": "Usa tecniche custom",
"Hint": "Aggiunge il tipo 'Speciale' come termine generale."
@@ -80,6 +84,41 @@
},
"l5r5e": {
"title": "Legend of the five Rings",
"conditions": {
"afflicted": "Afflicted",
"bleeding": "Bleeding",
"burning": "Burning",
"centered": "Centered",
"compromised": "Compromised",
"dazed": "Dazed",
"disoriented": "Disoriented",
"dying": "Dying",
"emboldened": "Emboldened",
"enraged": "Enraged",
"exhausted": "Exhausted",
"immobilized": "Immobilized",
"illness_coughing_illness": "Illness: Coughing Illness",
"illness_fire_rash": "Illness: Fire Rash",
"illness_gut_sickness": "Illness: Gut Sickness",
"illness_oozing_sore_disease": "Illness: Oozing Sore Disease",
"illness_unsteady_illness": "Illness: Unsteady Illness",
"incapacitated": "Incapacitated",
"intoxicated": "Intoxicated",
"possessed": "Possessed",
"prone": "Prone",
"silenced": "Silenced",
"unconscious": "Unconscious",
"lightly_wounded_fire": "Lightly Wounded (Fire)",
"lightly_wounded_water": "Lightly Wounded (Water)",
"lightly_wounded_air": "Lightly Wounded (Air)",
"lightly_wounded_earth": "Lightly Wounded (Earth)",
"lightly_wounded_void": "Lightly Wounded (Void)",
"severely_wounded_fire": "Severely Wounded (Fire)",
"severely_wounded_water": "Severely Wounded (Water)",
"severely_wounded_air": "Severely Wounded (Air)",
"severely_wounded_earth": "Severely Wounded (Earth)",
"severely_wounded_void": "Severely Wounded (Void)"
},
"global": {
"edge_translation_disclaimer": "",
"add": "Aggiungi",

View File

@@ -125,6 +125,22 @@ export class ActorL5r5e extends Actor {
});
}
/** @inheritDoc */
async _preUpdate(changes, options, user) {
if (this.isCharacterType) {
// apply compromised condition if strife goes beyond max
const strife = changes.system?.strife?.value ?? this.system.strife.value;
const isCompromised = strife > this.system.composure;
// apply incapacitated if fatigue goes beyond max endurance
const fatigue = changes.system?.fatigue?.value ?? this.system.fatigue.value;
const isIncapacitated = fatigue > this.system.endurance;
await Promise.all([
this.toggleStatusEffect('compromised', {active: isCompromised}),
this.toggleStatusEffect('incapacitated', {active: isIncapacitated}),
]);
}
}
/** @override */
prepareData() {
super.prepareData();
@@ -137,13 +153,16 @@ export class ActorL5r5e extends Actor {
ActorL5r5e.computeDerivedAttributes(system);
}
const isAfflicted = this.statuses.has("afflicted");
const isCompromised = this.statuses.has("compromised");
// Attributes bars
system.fatigue.max = system.endurance;
system.strife.max = system.composure;
system.void_points.max = system.rings.void;
// if compromise, vigilance = 1
system.is_compromised = system.strife.value > system.strife.max;
// if compromised or afflicted, vigilance = 1
system.is_afflicted_or_compromised = isAfflicted || isCompromised;
// Make sure void points are never greater than max
if (system.void_points.value > system.void_points.max) {
@@ -188,6 +207,21 @@ export class ActorL5r5e extends Actor {
return this._updateActorFromAdvancement(item, false);
}
/**
* @type {import("./types").Condition}
*
* Remove conditions by known string ids
* @param conditions {Set<Condition>}
* @returns {Promise<void>}
*/
async removeConditions(conditions) {
const effectsToRemove = this.statuses.intersection(conditions);
const idsToRemove = this.effects.contents
.filter(effect => effect.statuses.isSubsetOf(effectsToRemove))
.map(effect => effect.id);
await this.deleteEmbeddedDocuments("ActiveEffect", idsToRemove);
}
/**
* Alter Actor skill/ring from a advancement
* @param {Item} item

View File

@@ -321,6 +321,73 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
// Fatigue/Strife +/-
html.find(".addsub-control").on("click", this._modifyFatigueOrStrife.bind(this));
// Effect remove/display
html.find(".effect-delete").on("click", this._removeEffectId.bind(this));
html.find(".effect-name").on("click", this._openEffectJournal.bind(this));
}
/**
* Remove an effect
* @param {Event} event
* @private
*/
_removeEffectId(event) {
event.preventDefault();
event.stopPropagation();
const effectId = $(event.currentTarget).data("effect-id");
if (!effectId) {
return;
}
const tmpItem = this.actor.effects.get(effectId);
if (!tmpItem) {
return;
}
const callback = async () => {
return this.actor.deleteEmbeddedDocuments("ActiveEffect", [effectId]);
};
// Holing Ctrl = without confirm
if (event.ctrlKey) {
return callback();
}
game.l5r5e.HelpersL5r5e.confirmDeleteDialog(
game.i18n.format("l5r5e.global.delete_confirm", { name: tmpItem.name }),
callback
);
}
/**
* Open the core linked journal effect if exist
* @param {Event} event
* @private
*/
async _openEffectJournal(event) {
event.preventDefault();
event.stopPropagation();
const effectId = $(event.currentTarget).data("effect-id");
if (!effectId) {
return;
}
const effect = this.actor.effects.get(effectId);
if (!effect?.system?.id && !effect?.system?.uuid) {
return;
}
const journal = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({
id: effect.system.id,
uuid: effect.system.uuid,
type: "JournalEntry",
});
if (journal) {
journal.sheet.render(true);
}
}
/**

View File

@@ -62,7 +62,7 @@ export class CombatL5r5e extends Combat {
// If the character was unprepared (such as when surprised), their base initiative value is their vigilance attribute.
// Minion NPCs can generate initiative value without a check, using their focus or vigilance attribute
let initiative =
isPrepared === "true" ? actorSystem.focus : actorSystem.is_compromised ? 1 : actorSystem.vigilance;
isPrepared === "true" ? actorSystem.focus : actorSystem.is_afflicted_or_compromised ? 1 : actorSystem.vigilance;
// Roll only for PC and Adversary
if (isPc || combatant.actor.isAdversary) {

View File

@@ -14,6 +14,173 @@ export const L5R5E = {
skillCostMultiplier: 2,
techniqueCost: 3,
},
// For rings wound to be aligned, add them first
conditions: [{
id: "lightly_wounded_fire",
name: "l5r5e.conditions.lightly_wounded_fire",
img: "systems/l5r5e/assets/icons/conditions/fire-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "lightly_wounded_water",
name: "l5r5e.conditions.lightly_wounded_water",
img: "systems/l5r5e/assets/icons/conditions/water-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "lightly_wounded_air",
name: "l5r5e.conditions.lightly_wounded_air",
img: "systems/l5r5e/assets/icons/conditions/air-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "lightly_wounded_earth",
name: "l5r5e.conditions.lightly_wounded_earth",
img: "systems/l5r5e/assets/icons/conditions/earth-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "lightly_wounded_void",
name: "l5r5e.conditions.lightly_wounded_void",
img: "systems/l5r5e/assets/icons/conditions/void-white.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_fire",
name: "l5r5e.conditions.severely_wounded_fire",
img: "systems/l5r5e/assets/icons/conditions/fire-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_water",
name: "l5r5e.conditions.severely_wounded_water",
img: "systems/l5r5e/assets/icons/conditions/water-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_air",
name: "l5r5e.conditions.severely_wounded_air",
img: "systems/l5r5e/assets/icons/conditions/air-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_earth",
name: "l5r5e.conditions.severely_wounded_earth",
img: "systems/l5r5e/assets/icons/conditions/earth-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "severely_wounded_void",
name: "l5r5e.conditions.severely_wounded_void",
img: "systems/l5r5e/assets/icons/conditions/void-black.webp",
system: { id: "L5RCoreCon000016" }
},{
id: "afflicted",
name: "l5r5e.conditions.afflicted",
img: "icons/magic/death/undead-ghost-scream-teal.webp",
system: { id: "L5RCoreCon000001" }
},{
id: "bleeding",
name: "l5r5e.conditions.bleeding",
img: "icons/skills/wounds/blood-drip-droplet-red.webp",
system: { id: "L5RCoreCon000002" }
},{
id: "burning",
name: "l5r5e.conditions.burning",
img: "icons/magic/fire/flame-burning-creature-skeleton.webp",
system: { id: "L5RCoreCon000003" }
},{
id: "centered",
name: "l5r5e.conditions.centered",
img: "systems/l5r5e/assets/icons/social.svg",
system: { id: "L5RCoreCon000022" }
},{
id: "compromised",
name: "l5r5e.conditions.compromised",
img: "icons/creatures/abilities/mouth-teeth-human.webp",
system: { id: "L5RCoreCon000004" }
},{
id: "dazed",
name: "l5r5e.conditions.dazed",
img: "icons/magic/light/beam-explosion-orange.webp",
system: { id: "L5RCoreCon000005" }
},{
id: "disoriented",
name: "l5r5e.conditions.disoriented",
img: "icons/magic/control/hypnosis-mesmerism-eye.webp",
system: { id: "L5RCoreCon000006" }
},{
id: "dying",
name: "l5r5e.conditions.dying",
img: "icons/magic/death/skull-humanoid-white-blue.webp",
system: { id: "L5RCoreCon000007" }
},{
id: "emboldened",
name: "l5r5e.conditions.emboldened",
img: "systems/l5r5e/assets/icons/social.svg",
system: { id: "L5RCoreCon000023" }
},{
id: "enraged",
name: "l5r5e.conditions.enraged",
img: "icons/skills/wounds/injury-face-impact-orange.webp",
system: { id: "L5RCoreCon000008" }
},{
id: "exhausted",
name: "l5r5e.conditions.exhausted",
img: "icons/magic/life/heart-glowing-red.webp",
system: { id: "L5RCoreCon000009" }
},{
id: "illness_coughing_illness",
name: "l5r5e.conditions.illness_coughing_illness",
img: "icons/svg/poison.svg",
system: { id: "L5RCoreCon000019" }
},{
id: "illness_fire_rash",
name: "l5r5e.conditions.illness_fire_rash",
img: "icons/svg/fire.svg",
system: { id: "L5RCoreCon000021" }
},{
id: "illness_gut_sickness",
name: "l5r5e.conditions.illness_gut_sickness",
img: "icons/svg/poison.svg",
system: { id: "L5RCoreCon000018" }
},{
id: "illness_oozing_sore_disease",
name: "l5r5e.conditions.illness_oozing_sore_disease",
img: "icons/svg/eye.svg",
system: { id: "L5RCoreCon000017" }
},{
id: "illness_unsteady_illness",
name: "l5r5e.conditions.illness_unsteady_illness",
img: "icons/svg/daze.svg",
system: { id: "L5RCoreCon000020" }
},{
id: "immobilized",
name: "l5r5e.conditions.immobilized",
img: "icons/magic/nature/root-vine-entangle-foot-green.webp",
system: { id: "L5RCoreCon000010" }
},{
id: "incapacitated",
name: "l5r5e.conditions.incapacitated",
img: "icons/magic/control/silhouette-hold-change-green.webp",
system: { id: "L5RCoreCon000011" }
},{
id: "intoxicated",
name: "l5r5e.conditions.intoxicated",
img: "icons/consumables/drinks/alcohol-jar-spirits-gray.webp",
system: { id: "L5RCoreCon000012" }
},{
id: "possessed",
name: "l5r5e.conditions.possessed",
img: "icons/svg/terror.svg",
system: { id: "L5RCoreCon000024" }
},{
id: "prone",
name: "l5r5e.conditions.prone",
img: "icons/magic/control/silhouette-fall-slip-prone.webp",
system: { id: "L5RCoreCon000013" }
},{
id: "silenced",
name: "l5r5e.conditions.silenced",
img: "icons/magic/control/mouth-smile-deception-purple.webp",
system: { id: "L5RCoreCon000014" }
},{
id: "unconscious",
name: "l5r5e.conditions.unconscious",
img: "icons/magic/control/sleep-bubble-purple.webp",
system: { id: "L5RCoreCon000015" }
}],
regex: {
techniqueDifficulty: /^@([TS]):([^|]+?)(?:\|(min|max)(?:\(([^)]+?)\))?)?$/,
},

View File

@@ -205,6 +205,7 @@ export class GmToolbox extends HandlebarsApplicationMixin(ApplicationV2) {
}
},
});
await actor.removeConditions(new Set(["exhausted"]));
}
GmToolbox.#uiNotification(allActors, "sleep");
@@ -216,7 +217,8 @@ export class GmToolbox extends HandlebarsApplicationMixin(ApplicationV2) {
static async #onSceneEnd(event) {
const allActors = event.button !== 0;
for await (const actor of game.actors.contents) {
if (!GmToolbox.#updatableCharacter(allActors, actor)) {
if (!GmToolbox.#updatableCharacter(allActors, actor)
|| actor.statuses.has("exhausted")) {
continue;
}

View File

@@ -189,12 +189,12 @@ export class HelpersL5r5e {
// Unknown pack object, iterate all packs
if (!document) {
for (const comp of game.packs) {
await Promise.all(game.packs.map(async (comp) => {
const tmpData = await comp.getDocument(id);
if (tmpData) {
document = HelpersL5r5e.createDocumentFromCompendium({ type, data: tmpData });
}
}
}));
}
// Final

View File

@@ -1,6 +1,20 @@
import { L5r5eHtmlMultiSelectElement } from "./misc/l5r5e-multiselect.js";
export default class HooksL5r5e {
/**
* Do initialization
*/
static async init() {
// L5R conditions
if (game.settings.get(CONFIG.l5r5e.namespace, "show-all-status-effects")) {
// Add L5R conditions to foundry conditions (don't restrict users)
CONFIG.statusEffects.push(...CONFIG.l5r5e.conditions);
} else {
// L5R conditions only
CONFIG.statusEffects = CONFIG.l5r5e.conditions;
}
}
/**
* Do anything after initialization but before ready
*/
@@ -66,7 +80,7 @@ export default class HooksL5r5e {
}
}
}
game.settings.set(CONFIG.l5r5e.namespace, "all-compendium-references", Array.from(references));
game.settings.set(CONFIG.l5r5e.namespace, "all-compendium-references", references);
}
/**
@@ -303,17 +317,17 @@ export default class HooksL5r5e {
}
// Setup filters
const officialContent = game.settings.get(CONFIG.l5r5e.namespace, "compendium-official-content-for-players");
const unofficialContent = game.settings.get(CONFIG.l5r5e.namespace, "compendium-unofficial-content-for-players");
const allCompendiumReferences = game.settings.get(CONFIG.l5r5e.namespace, "all-compendium-references")
const officialContentSet = game.settings.get(CONFIG.l5r5e.namespace, "compendium-official-content-for-players");
const unofficialContentSet = game.settings.get(CONFIG.l5r5e.namespace, "compendium-unofficial-content-for-players");
const allCompendiumReferencesSet = game.settings.get(CONFIG.l5r5e.namespace, "all-compendium-references")
const hideEmptySourcesFromPlayers = game.settings.get(CONFIG.l5r5e.namespace, "compendium-hide-empty-sources-from-players");
const unavailableSourceForPlayers = allCompendiumReferences.filter((element) => {
const unavailableSourceForPlayersSet = new Set([...allCompendiumReferencesSet].filter((element) => {
if (CONFIG.l5r5e.sourceReference[element]) {
return officialContent.size > 0 ? !officialContent.has(element) : false;
return officialContentSet.size > 0 ? !officialContentSet.has(element) : false;
}
return unofficialContent.size > 0 ? !unofficialContent.has(element) : false;
});
return unofficialContentSet.size > 0 ? !unofficialContentSet.has(element) : false;
}));
// Create filter function
const applyCompendiumFilter = () => {
@@ -333,7 +347,7 @@ export default class HooksL5r5e {
let shouldShow = true;
// Handle unavailable sources
if (unavailableSourceForPlayers.has(lineSource)) {
if (unavailableSourceForPlayersSet.has(lineSource)) {
if (game.user.isGM) {
shouldShow &= true;
$(this)
@@ -405,33 +419,33 @@ export default class HooksL5r5e {
if (filtersToShow.source) {
// Build the source select
const selectableSources = allCompendiumReferences.map((reference) => ({
const selectableSourcesArray = [...allCompendiumReferencesSet].map((reference) => ({
value: reference,
label: CONFIG.l5r5e.sourceReference[reference]?.label ?? reference,
translate: true,
group: CONFIG.l5r5e.sourceReference[reference]?.type.split(",")[0] ?? "l5r5e.multiselect.sources_categories.others",
disabled: !sourcesInThisCompendium.has(reference) || (!game.user.isGM && unavailableSourceForPlayers.has(reference))
disabled: !sourcesInThisCompendium.has(reference) || (!game.user.isGM && unavailableSourceForPlayersSet.has(reference))
}));
const filterSourcesBox = L5r5eHtmlMultiSelectElement.create({
name: "filter-sources",
options: selectableSources,
options: selectableSourcesArray,
localize: true,
});
header.append(filterSourcesBox.outerHTML);
$("l5r5e-multi-select").on("change", applyCompendiumFilter);
// If gm add an extra button to easily filter the content to see the same stuff as a player
if (game.user.isGM && unavailableSourceForPlayers.length > 0) {
if (game.user.isGM && unavailableSourceForPlayersSet.size > 0) {
const buttonHTML = `<button type="button" class="gm" data-tooltip="${game.i18n.localize('l5r5e.multiselect.player_filter_tooltip')}">`
+ game.i18n.localize('l5r5e.multiselect.player_filter_label')
+ '</button>'
const filterPlayerView = allCompendiumReferences
.filter((item) => !unavailableSourceForPlayers.has(item))
const filterPlayerViewArray = [...allCompendiumReferencesSet]
.filter((item) => !unavailableSourceForPlayersSet.has(item))
.filter((item) => sourcesInThisCompendium.has(item));
$(buttonHTML).appendTo($(header).find("l5r5e-multi-select")).click(function() {
header.find("l5r5e-multi-select")[0].value = filterPlayerView;
header.find("l5r5e-multi-select")[0].value = filterPlayerViewArray;
});
}
}

View File

@@ -56,8 +56,8 @@ export class BaseItemSheetL5r5e extends foundry.appv1.sheets.ItemSheet {
sheetData.data.system.source_reference.source = game.i18n.localize(label_or_reference);
// Translate list of available references
const all_references = game.settings.get(CONFIG.l5r5e.namespace, "all-compendium-references");
sheetData.source_references = all_references.map((reference) => {
const all_referencesSet = game.settings.get(CONFIG.l5r5e.namespace, "all-compendium-references");
sheetData.source_references = [...all_referencesSet].map((reference) => {
const label_or_reference = CONFIG.l5r5e.sourceReference[reference]?.label ?? reference
return game.i18n.localize(label_or_reference)
})

View File

@@ -37,31 +37,26 @@ export class ItemSheetL5r5e extends BaseItemSheetL5r5e {
* @private
*/
async _prepareProperties(sheetData) {
sheetData.data.propertiesList = [];
sheetData.data.propertiesList = await Promise.all((sheetData.data?.system?.properties || []).map(async (property) => {
if (Array.isArray(sheetData.data.system.properties)) {
const props = [];
for (const property of sheetData.data.system.properties) {
const gameProp = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({ id: property.id, type: "Item" });
if (gameProp) {
sheetData.data.propertiesList.push(gameProp);
props.push({ id: gameProp.id, name: gameProp.name });
} else {
// Item not found
console.warn(`L5R5E | IS | Unknown property id[${property.id}], name[${property.name}]`);
sheetData.data.propertiesList.push({
id: property.id,
name: property.name,
type: "property",
img: "systems/l5r5e/assets/icons/items/property.svg",
removed: true,
});
}
const gameProp = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({ id: property.id, type: "Item" });
if (gameProp) {
return gameProp;
}
sheetData.data.system.properties = props;
}
// Item not found
console.warn(`L5R5E | IS | Unknown property id[${property.id}], name[${property.name}]`);
return {
id: property.id,
name: property.name,
type: "property",
img: "systems/l5r5e/assets/icons/items/property.svg",
removed: true,
};
}));
}
/**
* Subscribe to events from the sheet.
* @param {jQuery} html HTML content of the sheet.

View File

@@ -252,6 +252,7 @@ Hooks.once("init", async () => {
/* ------------------------------------ */
Hooks.once("setup", HooksL5r5e.setup);
Hooks.once("ready", HooksL5r5e.ready);
Hooks.once("init", HooksL5r5e.init);
Hooks.once("diceSoNiceReady", (dice3d) => HooksL5r5e.diceSoNiceReady(dice3d));
/* ------------------------------------ */

View File

@@ -19,6 +19,12 @@ export class L5r5ePopupManager {
/** @type {HTMLElement} */
#container = null;
/**
* Increment number to ignore old tooltips if template is too long to load (#62)
* @type {number}
*/
#displayId = 0;
/**
* @param {string|jQuery} selector - Selector or jQuery object for tooltip-bound elements.
* @param {(event: MouseEvent) => Promise<string>} callback - Async function returning tooltip HTML content.
@@ -45,10 +51,24 @@ export class L5r5ePopupManager {
.on("mouseenter.popup", async (event) => {
$(this.#container).find("#l5r5e-tooltip-ct").remove();
// Memory save
if (this.#displayId >= 200) {
this.#displayId = 0;
}
const currentDisplayId = ++this.#displayId;
// Load the template, can take a while
const tpl = await this.#callback(event);
// Abort if no content or the target element is no longer in the DOM
if (!tpl || !document.body.contains(event.currentTarget)) return;
if (!tpl || !document.body.contains(event.currentTarget)) {
return;
}
// If mismatched, that tpl is too old, the user already display another tooltip
if (this.#displayId !== currentDisplayId) {
return;
}
$(this.#container).append(
`<div id="l5r5e-tooltip-ct" class="l5r5e-tooltip l5r5e-tooltip-ct">${tpl}</div>`

View File

@@ -25,6 +25,15 @@ export const RegisterSettings = function () {
type: Boolean,
default: true,
});
game.settings.register(CONFIG.l5r5e.namespace, "show-all-status-effects", {
name: "SETTINGS.ShowAllStatusEffects.Title",
hint: "SETTINGS.ShowAllStatusEffects.Hint",
scope: "world",
config: true,
type: Boolean,
default: false,
requiresReload: true,
});
game.settings.register(CONFIG.l5r5e.namespace, "techniques-customs", {
name: "SETTINGS.CustomTechniques.Title",
hint: "SETTINGS.CustomTechniques.Hint",

3
system/scripts/types.js Normal file
View File

@@ -0,0 +1,3 @@
/**
* @typedef {"afflicted" | "bleeding" | "burning" | "centered" | "compromised" | "dazed" | "disoriented" | "dying" | "emboldened" | "enraged" | "exhausted" | "illness_coughing_illness" | "illness_fire_rash" | "illness_gut_sickness" | "illness_oozing_sore_disease" | "illness_unsteady_illness" | "immobilized" | "incapacitated" | "intoxicated" | "possessed" | "prone" | "silenced" | "unconscious" | "lightly_wounded_fire" | "lightly_wounded_water" | "lightly_wounded_air" | "lightly_wounded_earth" | "lightly_wounded_void" | "severely_wounded_fire" | "severely_wounded_water" | "severely_wounded_air" | "severely_wounded_earth" | "severely_wounded_void"} Condition
*/

File diff suppressed because one or more lines are too long

View File

@@ -122,11 +122,6 @@ body {
}
/* Focus, Active */
* {
transition-property: background, color, border-color, text-shadow, box-shadow;
transition-duration: 0.5s;
transition-timing-function: ease;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
@@ -309,4 +304,3 @@ a.compendium-link {
color: #0096ff;
}
}

View File

@@ -67,13 +67,21 @@
border-radius: 4px;
background-color: rgba(0, 0, 0, 0.4);
padding: 3px;
display: flex;
}
.effect-delete {
width: 16px;
height: 16px;
background-repeat: no-repeat;
background-size: contain;
text-align: end;
cursor: url("../assets/cursors/pointer.webp"), pointer;
}
.effect-icon {
width: 16px;
height: 16px;
background-repeat: no-repeat;
background-size: contain;
float: left;
}
.effect-name {
vertical-align: top;
@@ -81,7 +89,6 @@
text-overflow: ellipsis;
white-space: nowrap;
color: $white;
float: right;
margin-left: 4px;
font-size: 14px;
line-height: 16px;

View File

@@ -7,8 +7,8 @@
"changelog": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/CHANGELOG.md",
"license": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/LICENSE.md",
"manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json",
"download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.13.0/raw/l5r5e.zip?job=build",
"version": "1.13.0",
"download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.13.1/raw/l5r5e.zip?job=build",
"version": "1.13.1",
"compatibility": {
"minimum": "13",
"verified": "13",

View File

@@ -36,10 +36,10 @@
</label>
<p class="item-description"> {{localize 'l5r5e.attributes.focustip'}}</p>
</li>
<li class="vigilance-content {{#if data.system.is_compromised}}compromised{{/if}}">
<li class="vigilance-content {{#if data.system.is_afflicted_or_compromised}}compromised{{/if}}">
<label class="attribute-label">
<strong>{{localize 'l5r5e.attributes.vigilance'}}</strong>
{{#if data.system.is_compromised}}
{{#if data.system.is_afflicted_or_compromised}}
<input class="centered-input" type="number" value="1" disabled/>
{{else}}
<input class="centered-input" type="number" name="system.vigilance" value="{{data.system.vigilance}}" data-dtype="Number" disabled/>

View File

@@ -2,7 +2,10 @@
{{#each actor.effects as |effect|}}
<li class="effect-container" title="{{name}}">
<div class="effect-icon" style="background-image: url({{effect.img}})"></div>
<div class="effect-name"><label>{{name}}</label></div>
<div data-effect-id="{{effect.id}}" class="effect-name"><label>{{name}}</label></div>
{{#if ../data.editable_not_soft_locked}}
<div data-effect-id="{{effect.id}}" class="effect-delete" title="{{localize 'Delete'}}"><i class="fas fa-remove"></i></div>
{{/if}}
</li>
{{/each}}
</ul>

View File

@@ -36,10 +36,10 @@
</label>
<p class="item-description"> {{localize 'l5r5e.attributes.focustip'}}</p>
</li>
<li class="vigilance-content {{#if data.system.is_compromised}}compromised{{/if}}">
<li class="vigilance-content {{#if data.system.is_afflicted_or_compromised}}compromised{{/if}}">
<label class="attribute-label">
<strong>{{localize 'l5r5e.attributes.vigilance'}}</strong>
{{#if data.system.is_compromised}}
{{#if data.system.is_afflicted_or_compromised}}
<input class="centered-input" type="number" value="1" disabled/>
{{else}}
<input class="centered-input" type="number" name="system.vigilance" value="{{data.system.vigilance}}" data-dtype="Number" min="0" placeholder="0" {{^if data.editable_not_soft_locked}}disabled{{/if}}/>

View File

@@ -2,7 +2,10 @@
{{#each actor.effects as |effect|}}
<li class="effect-container" title="{{name}}">
<div class="effect-icon" style="background-image: url({{effect.img}})"></div>
<div class="effect-name"><label>{{name}}</label></div>
<div data-effect-id="{{effect.id}}" class="effect-name"><label>{{name}}</label></div>
{{#if ../data.editable_not_soft_locked}}
<div data-effect-id="{{effect.id}}" class="effect-delete" title="{{localize 'Delete'}}"><i class="fas fa-remove"></i></div>
{{/if}}
</li>
{{/each}}
</ul>

View File

@@ -69,7 +69,7 @@
</td>
<td>
{{actor.system.focus}}
/ {{#if actor.system.is_compromised}}<span class="badvalue">1</span>{{else}}{{actor.system.vigilance}}{{/if}}
/ {{#if actor.system.is_afflicted_or_compromised}}<span class="badvalue">1</span>{{else}}{{actor.system.vigilance}}{{/if}}
</td>
<td>
<a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-uuid="{{actor.uuid}}" data-type="void_points" class="actor-modify-control">

View File

@@ -68,7 +68,7 @@
</td>
<td>
{{actor.system.focus}}
/ {{#if actor.system.is_compromised}}<span class="badvalue">1</span>{{else}}{{actor.system.vigilance}}{{/if}}
/ {{#if actor.system.is_afflicted_or_compromised}}<span class="badvalue">1</span>{{else}}{{actor.system.vigilance}}{{/if}}
</td>
<td>
<a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-uuid="{{actor.uuid}}" data-action="modify_voidPoint" class="actor-modify-control">