From 519bc36ca33431cdca87af7af698a4e3ac13479d Mon Sep 17 00:00:00 2001 From: RassilonMonk Date: Mon, 29 Apr 2024 09:50:08 -0400 Subject: [PATCH] Disease wording fixes and added Purblind localization (#41) * Disease wording fixes and added Purblind localization * Added Purblind disease symptom code. Also minor standard formatting fixes * Added 2 new symptoms Wasting and Dementia to en localization and disease code * whooops. Capitalization matters. fix on localization string values * whooops. So do perentheses. Fixed new single line if statements and added ws and bs to Wither symptom --- dist/languages/en.json | 23 +++++++- dist/modules/features/Diseases.mjs | 90 +++++++++++++++++++++++++++++- 2 files changed, 108 insertions(+), 5 deletions(-) diff --git a/dist/languages/en.json b/dist/languages/en.json index 16bb2fd..a6f61dd 100644 --- a/dist/languages/en.json +++ b/dist/languages/en.json @@ -344,17 +344,17 @@ "Symptoms": { "Vertigo": { "Name": "Vertigo", - "Description": "You have trouble staying balanced and feel the sensation of spinning around. All Weapon Tests, as well as Tests based on either Agility, Dexterity, or Intelligence suffer a penalty of –2 SL while you are dizzy.", + "Description": "You have trouble staying balanced and feel the sensation of spinning around. All Weapon Tests, as well as Tests based on either Agility, Dexterity, or Intelligence suffer a penalty of -2 SL while you are dizzy.", "Treatment": "There is no treatment available for Vertigo, this symptom ends when the cause of it ends." }, "Scarring": { "Name": "Scarring", - "Description": "You have been horribly scarred by your ordeal and your appearance unsettles or disgusts other. As a result you suffer a –10 penalty to all Fellowship Tests.", + "Description": "You have been horribly scarred by your ordeal and your appearance unsettles or disgusts others. As a result you suffer a -10 penalty to all Fellowship Tests.", "Treatment": "Scarring is usually permanent barring special magic." }, "Rashes": { "Name": "Rashes", - "Description": "You have a number of red, itchy rashes. As a result your appearance is slightly marred and you lose some of your deftness as you scratch and squirm. Receive a –5 modifier to your Dexterity and Fellowship Characteristics.", + "Description": "You have numerous red, itchy rashes. As a result your appearance is slightly marred and you lose some of your deftness as you scratch and squirm. Receive a -5 modifier to your Dexterity and Fellowship Characteristics.", "Treatment": "Depending on the disease some herbs and alchemical mixes can alleviate rashes. Of course there are also many fake remedies available for sale that do nothing and a purchased treatment has a 10% chance of being snake-oil. Treatments cost from 10 brass pennies and upwards depending on the status of the purchaser and the reputation of the seller. Anyone with Trade (Apothecary) or Trade (Alchemist) with access to appropriate ingredients (costing 5 pennies) can create enough salve that when applied daily can alleviate the symptoms for a week." }, "Taint": { @@ -362,7 +362,24 @@ "Description": "This disease is tainted by the powers of Chaos and affects the very soul of the suffering victim. Unless the victim passes a Challenging (+0) Endurance Test, they suffer 1 point of @UUID[JournalEntry.NS3YGlJQxwTggjRX.JournalEntryPage.115GzWrmkD4viyy5]{Corruption}.", "Treatment": "There is no treatment for the Taint.", "Failure": "{character} gains 1 point of Corruption" + }, + "Purblind": { + "Name": "Purblind", + "Description": "Your eyes have been afflicted causing them to swell and weep pus, blood or other fluids. You are blinded to a degree based on how severe it is. You suffer a -10 penalty to all sight-based attributes and skill checks including attacks. This penalty rises to -20 for Moderate, and -30 for Severe levels of affliction.", + "Treatment": "This symptom lasts until the source of it has been dealt with. Cold cloths with a mix of medicinal herbs can be applied over the eyes to help relieve some of the pressure, but that will not help with the loss of sight." + }, + "Wasting": { + "Name": "Wasting", + "Description": "This disease has attacked and atrophied your muscles and ligaments. As the disease progresses you are gradually wasting away and suffer from a -10 penalty to your Strength, Agility, Toughness and Dexterity, as well as all Weapon Tests. This penalty grows to -20 for Moderate and -30 for Severe. Any victim whose Toughness is reduced to 0 eventually dies from the disease as it runs its course.", + "Treatment": "Wasting can only be cured by addressing the underlying disease. A subject who is being cared for and well fed above their normal intake (Requiring a status expenditure of 2 Standing levels higher than your career) can make a weekly Difficult (-10) Endurance Test to temporarily reduce the effect by 10 for a week." + }, + "Dementia": { + "Name": "Dementia", + "Description": "The disease has influenced your cognitive faculties. Your ability to think clearly, reason, or remember is adversely affected and you suffer a -20 penalty to your Intelligence and -15 to your Initiative.", + "Treatment": "There is no known treatment for Dementia, and it lasts for the duration of the disease affecting your thinking capacity." } + + }, "Settings": { diff --git a/dist/modules/features/Diseases.mjs b/dist/modules/features/Diseases.mjs index b2a2b69..b88a2dd 100644 --- a/dist/modules/features/Diseases.mjs +++ b/dist/modules/features/Diseases.mjs @@ -98,7 +98,7 @@ export default class Diseases extends ForienBaseModule { ` } } - } + }; //#endregion //#region Taint @@ -134,7 +134,93 @@ export default class Diseases extends ForienBaseModule { ` } } - } + }; + //#endregion + + //#region Purblind + config.symptoms["purblind"] = game.i18n.localize("Forien.Armoury.Symptoms.Purblind.Name"); + config.symptomDescriptions["purblind"] = game.i18n.localize("Forien.Armoury.Symptoms.Purblind.Description"); + config.symptomTreatment["purblind"] = game.i18n.localize("Forien.Armoury.Symptoms.Purblind.Treatment"); + config.symptomEffects["purblind"] = { + name: game.i18n.localize("Forien.Armoury.Symptoms.Purblind.Name"), + icon: "modules/wfrp4e-core/icons/diseases/disease.png", + transfer: true, + flags: { + wfrp4e: { + "effectApplication": "actor", + "effectTrigger": "prefillDialog", + "symptom": true, + "script": ` + let modifier = -10; + if (this.effect.name.includes("Severe")) { + modifier = -30; + } else if (this.effect.name.includes("Moderate")) { + modifier = -20; + } + + let applicableSkills = ["Art","Dodge","Drive","Evaluate","Melee","Navigation","Perception","Pick Lock","Ranged","Research","Ride","Row","Sail","Secret Signs","Set Trap","Stealth", "Track"]; + let applicableCharacteristics = ["ws", "bs", "ag", "dex"]; + + if ((args.type === "weapon") || (args.type === "characteristic" && applicableCharacteristics.includes(args.item)) || (args.type === "skill" && applicableSkills.includes(args.item.name))) { + args.prefillModifiers.modifier += modifier; + } + ` + } + } + }; + //#endregion + + //#region Wasting + config.symptoms["wasting"] = game.i18n.localize("Forien.Armoury.Symptoms.Wasting.Name"); + config.symptomDescriptions["wasting"] = game.i18n.localize("Forien.Armoury.Symptoms.Wasting.Description"); + config.symptomTreatment["wasting"] = game.i18n.localize("Forien.Armoury.Symptoms.Wasting.Treatment"); + config.symptomEffects["wasting"] = { + name: game.i18n.localize("Forien.Armoury.Symptoms.Wasting.Name"), + icon: "modules/wfrp4e-core/icons/diseases/disease.png", + transfer: true, + flags: { + wfrp4e: { + "effectApplication": "actor", + "effectTrigger": "prefillDialog", + "symptom": true, + "script": ` + let modifier = -10; + if (this.effect.name.includes("Severe")) { + modifier = -30; + } else if (this.effect.name.includes("Moderate")) { + modifier = -20; + } + let applicableCharacteristics = ["s", "t", "ag", "ws", "bs", "dex"]; + + if ((args.type === "weapon") || (args.type === "characteristic" && applicableCharacteristics.includes(args.item)) || (args.type === "skill" && applicableCharacteristics.includes(args.item.characteristic.key))) { + args.prefillModifiers.modifier += modifier; + } + ` + } + } + }; + //#endregion + + //#region Dementia + config.symptoms["dementia"] = game.i18n.localize("Forien.Armoury.Symptoms.Dementia.Name"); + config.symptomDescriptions["dementia"] = game.i18n.localize("Forien.Armoury.Symptoms.Dementia.Description"); + config.symptomTreatment["dementia"] = game.i18n.localize("Forien.Armoury.Symptoms.Dementia.Treatment"); + config.symptomEffects["dementia"] = { + name: game.i18n.localize("Forien.Armoury.Symptoms.Dementia.Name"), + icon: "modules/wfrp4e-core/icons/diseases/disease.png", + transfer: true, + flags: { + wfrp4e: { + "effectApplication": "actor", + "effectTrigger": "prePrepareData", + "symptom": true, + "script": ` + args.actor.system.characteristics.i.modifier -= 15; + args.actor.system.characteristics.int.modifier -= 20; + ` + } + } + }; //#endregion return config;