/************************************************************************************/
const _patch_eis = () => {
WFRP4E.symptoms["delirium"] = "Délire"
WFRP4E.symptomDescriptions["delirium"] = "Your sensibility comes and goes, with moments of clarity replaced suddenly by bouts of raving, hallucinations, and terror. Make a Challenging (+0) Willpower Test each hour, and consult the Delirium table."
// '
' creates a new line
// This is how you can roll from chat cards. Wrap 'd10' in ___
WFRP4E.symptomTreatment["delirium"] = "Some authorities treat delirium as part of a fever, prescribing the same measures. Remedies cost from a few pennies to a few shillings, and 10% are genuine.
With the correct medicin e, a successful Challenging (+0) Heal Test banishes the hallucinations for 1d10 hours.
It is also common to sedate delirious patients with a tranquillising drug, such as Moonflower or even Nightshade, to keep the patient comfortable until the condition has passed, sending them into a Fitful Sleep until they either recover or die."
WFRP4E.symptoms["swelling"] = "Swelling"
WFRP4E.symptomDescriptions["swelling"] = "A part of the body swells up to several times its normal size, turning an angry red or purple colour and becoming almost unusable. The affected body part is normally the location of a wound or bite causing the Swelling, or the point of contact where a disease or infection entered the body.
Head: The eyes and tongue bulge, the cheeks become livid, the jaw is forced open. Eating is impossible, but clear liquids maybe sipped in small quantities. Any Tests requiring speech are 3 steps more Difficult.
Arm:The arm and hand swell, the shoulder and elbow joints cannot move, and the hand becomes useless. For the duration, the arm counts as Amputated (WFRP, page 180).
Body: The entire body swells until the sufferer can no longer wear clothes. All Tests involving movement become 3 steps more Difficult.
Leg: The leg swells grotesquely, becoming as wide as the widest part of the thigh for its entire length. The foot is almost indistingushable. For the duration, the leg counts as Amputated (WFRP, page 180)."
WFRP4E.symptomTreatment["swelling"] = "Most treatments involve plunging the affected part, or sometimes the whole body, into an ice-water bath to reduce the heat that accompanies the swellings. An Extended Hard (-20) Heal Test requiring +3 SL reduces the swelling by 2d10 hours. Each Test takes an hour. The patient is left with +1 Fatigued Condition for every Test made in the process.
Some physicians instead bleed the patient with a blade or leeches. A successful Extended Heal Test requiring +4 SL and Trade Tools (Physician) reduces the swelling by (1d10 + the patient's Toughness Bonus) hours. Each Test has a base Difficulty of Impossible (-50) and takes half an hour."
WFRP4E.difficultyModifiers["futile"] = -40
WFRP4E.difficultyModifiers["impossible"] = -50
WFRP4E.difficultyLabels["futile"] = "Futile (-40)"
WFRP4E.difficultyLabels["impossible"] = "Impossible (-50)"
WFRP4E.loreEffect["tzeentch"] = "Les cibles des sorts de Tzeentch sont déchirées par la magie transformatrice du Chaos. Les cibles affectées par un sort du savoir de Tzeentch doivent réussir un test d'endurance Intermédiaire (+0) ou gagner +1 Point de Corruption. S'ils réussissent leur test, ils gagnent à la place +1 Point de Chance, qui peut être utilisé normalement. Tels sont les caprices de Tzeentch"
}
/************************************************************************************/
/* Manages /auberge command */
const _manage_inn_roll = async (content, msg) => {
// Split input into arguments
let command = content.split(" ").map(function(item) {
return item.trim();
})
if (command[0] == "/auberge" && command[1] )
{
msg["type"] = 0;
msg["rollMode"] = "gmroll";
var compendium = game.packs.get('WH4-fr-translation.plats-dauberges');
let rollList = [];
await compendium.getIndex().then(index => rollList = index);
//console.log("Got compendium...", rollList.length);
for (var i=0; i< rollList.length; i++) {
var rollTab = rollList[i];
if ( rollTab.name.toLowerCase().includes(command[1].toLowerCase()) ) {
let my_rollTable;
await compendium.getEntity(rollTab._id).then(mytab => my_rollTable = mytab);
let myroll = my_rollTable.roll();
//console.log("RES: ", myroll );
msg.content = my_rollTable.name + " : " + myroll.results[0].text;
//my_rollTable.draw();
ChatMessage.create(msg);
return false;
}
}
}
if ( content.includes("/auberge") ) {
msg["type"] = 0;
msg["rollMode"] = "gmroll";
msg["content"] = "Syntaxe : /auberge MOT_CLE, avec MOT_CLE parmi:
BoissonsBase, BoissonsFortes, Desserts, PlatsCommuns, PlatsExcellents, PlatsMaritimes, PlatsMédiocres, PlatsQualité, PlatsRivières
Des raccourcis sont possibles avec une partie du nom : /auberge Base (correspond à BoissonBase) ou /auberge Mari (correspond à PlatsMaritimes), etc."
ChatMessage.create(msg);
return false;
}
}
/************************************************************************************/
const setup_wfrp4e_tables = () => {
}
/************************************************************************************/
/* Hook for specific command */
Hooks.on("chatMessage", (html, content, msg) => {
if ( content.includes("/auberge") ) {
_manage_inn_roll( content, msg );
return false;
}
} );
/************************************************************************************/
/* Additionnal hooks ready */
Hooks.once('ready', () => {
_patch_eis();
setup_wfrp4e_tables();
// Sanity check + message
game.modules.forEach((module, name) => {
if ( name == "wfrp4e-rnhd" && module.active ) {
ChatMessage.create( { "title": "Module non compatible detecté !", "content": "Vous avez le module Rough Nights & Hard Days installé. Malheureusement, ce module n'est pas compatible avec" +
" les traductions et vient casser le fonctionnement de la traduction. Veuillez recopier les compendiums dans votre monde, désactiver le module et re-démarrer le monde", } );
}
if ( name == "wfrp4e-ew" && module.active ) {
ChatMessage.create( { "title": "Module non compatible detecté !", "content": "Vous avez le module EW (wfrp4e-ew ?) installé. Malheureusement, ce module n'est pas compatible avec" +
" les traductions et vient casser le fonctionnement de la traduction. Veuillez recopier les compendiums dans votre monde, désactiver le module et re-démarrer le monde", } );
}
} );
const lang = game.settings.get('core', 'language');
if ( lang == "fr" ) {
let pack_array = [];
game.packs.forEach((pack, name) => {
let newpack = pack;
if(!pack.translated && pack.entity === 'Actor') {
let translations = {
"label": pack.metadata.name,
"mapping": {
"name": "name",
"description": "details.biography.value",
"items": {
"path": "items",
"converter": "bestiary_traits"
},
"characteristics": {
"path": "data.characteristics",
"converter": "npc_characteristics"
}
},
"entries": [
]
};
newpack = new TranslatedCompendium(pack, translations);
console.log("Actor compendium has been replaced !!!!", newpack);
}
pack_array.push( [name, newpack ] );
} );
game.packs = new Collection( pack_array );
}
} );