From 62340e2f180510d63bb678aa0504aa4372b48ccf Mon Sep 17 00:00:00 2001 From: marcom Date: Sun, 7 Mar 2021 16:22:08 -0800 Subject: [PATCH 1/6] modified to take in account monster stats monster stats --- module/actor/actor-sheet.js | 12 +++++++++--- module/roll/roll.js | 29 +++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index b4ce9c5..b2bd2ea 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -320,13 +320,19 @@ export class DeltaGreenActorSheet extends ActorSheet { let requestedModifyRoll = (event && event.shiftKey || event.which === 3); //(event && (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey)); // check the 'data-target="something" property to determine how to grab the target for the roll + let inhuman_flag = false; // inhuman_flag to be used for stats above 20 if(rollType === "skill" || rollType === "typeskill"){ targetVal = dataset.target; label = game.i18n.localize(label).toUpperCase(); } else if(dataset.target === "statistic.x5"){ let stat = this.actor.data.data.statistics[key]; - targetVal = stat.x5; + if (stat.value>=20){ + targetVal = stat.value; + inhuman_flag = true; // you use the value instead of the x5 but you set the inhuman_flag to true + }else{ + targetVal = stat.x5; + } label = game.i18n.localize("DG.Attributes." + key).toUpperCase(); } else if(rollType === "sanity"){ @@ -354,7 +360,7 @@ export class DeltaGreenActorSheet extends ActorSheet { } else{ if(requestedModifyRoll){ - showModifyPercentileTestDialogue(this.actor, label, targetVal, isLethalityRoll); + showModifyPercentileTestDialogue(this.actor, label, targetVal, isLethalityRoll,inhuman_flag); } else{ if(isLethalityRoll) @@ -362,7 +368,7 @@ export class DeltaGreenActorSheet extends ActorSheet { sendLethalityTestToChat(this.actor, label, targetVal); } else{ - sendPercentileTestToChat(this.actor, label, targetVal); + sendPercentileTestToChat(this.actor, label, targetVal,inhuman_flag); } } } diff --git a/module/roll/roll.js b/module/roll/roll.js index c607e67..54c5c4b 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -1,4 +1,4 @@ -export function sendPercentileTestToChat(actor, skill, target){ +export function sendPercentileTestToChat(actor, skill, target, inhuman_flag=false){ // flag check if the stat is above 20 let roll = new Roll('1D100', actor.data.data).roll(); let total = roll.total; let isCritical = false; @@ -8,11 +8,24 @@ export function sendPercentileTestToChat(actor, skill, target){ let resultString = ''; let styleOverride = ''; - isCritical = skillCheckResultIsCritical(total); - - if(total <= target){ - isSuccess = true; - } + isCritical = skillCheckResultIsCritical(total); // up to this point everything works as intended + + if (inhuman_flag){ // pag 188 of the Handler guide: inhuman stats + //an entity with a stat at 20 or higher succeeds at any stat test except with a roll of 100, which fails + //and fumbles. It gets a critical success on any success with matching digits, and with any roll equal + //to or less than the stat’s value. + + if(total <= 99){ + isSuccess = true; + if(total <= target){ + isCritical = true; + } + } + }else{ // general case + if(total <= target){ + isSuccess = true; + } + } if(isCritical){ resultString = `${game.i18n.localize("DG.Roll.Critical")} `; @@ -189,7 +202,7 @@ export function sendPercentileTestToChat(actor, skill, target){ }); } - export async function showModifyPercentileTestDialogue(actor, label, originalTarget, isLethalityTest){ + export async function showModifyPercentileTestDialogue(actor, label, originalTarget, isLethalityTest,inhuman_flag=false){ let template = "systems/deltagreen/templates/dialog/modify-percentile-roll.html"; let backingData = { @@ -223,7 +236,7 @@ export function sendPercentileTestToChat(actor, skill, target){ sendLethalityTestToChat(actor, label, newTarget); } else{ - sendPercentileTestToChat(actor, label, newTarget); + sendPercentileTestToChat(actor, label, newTarget,inhuman_flag); //take care of inhuman stat, by default the value is false } } catch(ex){ From 7d44b091422e9e2315444c9b1d897b55b552c868 Mon Sep 17 00:00:00 2001 From: uriele Date: Sun, 7 Mar 2021 16:26:58 -0800 Subject: [PATCH 2/6] Update system.json --- system.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system.json b/system.json index 8881bb3..f0569ce 100644 --- a/system.json +++ b/system.json @@ -1,6 +1,6 @@ { "name": "deltagreen", - "title": "Delta Green (Unofficial)", + "title": "Delta Green (Unofficial) fork", "description": "Fan-made Foundry VTT system for Delta Green: The Role Playing Game for Foundry VTT. Based on the rules in the Agent's Handbook (https://www.drivethrurpg.com/product/181674/Delta-Green-Agents-Handbook). Made with the permission of but neither affiliated with nor endorsed by Arc Dream Publishing or the Delta Green Partnership.", "version": "0.9.7", "minimumCoreVersion": "0.6.2", @@ -52,8 +52,8 @@ "gridUnits": "m", "primaryTokenAttribute": "health", "secondaryTokenAttribute": "wp", - "url": "https://github.com/TheLastScrub/delta-green-foundry-vtt-system-unofficial", - "manifest": "https://github.com/TheLastScrub/delta-green-foundry-vtt-system-unofficial/raw/master/system.json", - "download": "https://github.com/TheLastScrub/delta-green-foundry-vtt-system-unofficial/archive/v0.9.7.zip", + "url": "https://github.com/uriele/delta-green-foundry-vtt-system-unofficial", + "manifest": "https://github.com/uriele/delta-green-foundry-vtt-system-unofficial/raw/master/system.json", + "download": "https://github.com/uriele/delta-green-foundry-vtt-system-unofficial/archive/v0.9.7.zip", "license": "LICENSE.txt" } From 8f6b41d1291e1eda188f141334579d1a2bace5da Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 13 Mar 2021 00:06:31 -0800 Subject: [PATCH 3/6] added +/- to label --- lang/en.json | 2 +- lang/es.json | 2 +- lang/ja.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/en.json b/lang/en.json index f6f43b9..8a2f345 100644 --- a/lang/en.json +++ b/lang/en.json @@ -207,7 +207,7 @@ "DG.ModifySkillRollDialogue.Title": "Modify Roll", "DG.ModifySkillRollDialogue.Test": "Test:", "DG.ModifySkillRollDialogue.OriginalTarget": "Original Target:", - "DG.ModifySkillRollDialogue.TargetModifier": "Modify Target:", + "DG.ModifySkillRollDialogue.TargetModifier": "Modify Target (+/-):", "DG.ModifySkillRollDialogue.ModifierTooltip": "Give a positive or negative modifier here to add/subtract from the target for the skill check.", "DG.ModifyDamageRollDialogue.Weapon": "Weapon:", diff --git a/lang/es.json b/lang/es.json index 163d200..1a12737 100644 --- a/lang/es.json +++ b/lang/es.json @@ -207,7 +207,7 @@ "DG.ModifySkillRollDialogue.Title": "Modificar Tirada", "DG.ModifySkillRollDialogue.Test": "Test:", "DG.ModifySkillRollDialogue.OriginalTarget": "Objetivo Original:", - "DG.ModifySkillRollDialogue.TargetModifier": "Modificar Objetivo:", + "DG.ModifySkillRollDialogue.TargetModifier": "Modificar Objetivo (+/-):", "DG.ModifySkillRollDialogue.ModifierTooltip": "Dar un modificador positivo o negativo aquí para sumar o restar al objetivo en la chequeo de habilidades.", "DG.ModifyDamageRollDialogue.Weapon": "Arma:", diff --git a/lang/ja.json b/lang/ja.json index 638e25f..46a4e59 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -207,7 +207,7 @@ "DG.ModifySkillRollDialogue.Title": "ロールの変更", "DG.ModifySkillRollDialogue.Test": "テスト:", "DG.ModifySkillRollDialogue.OriginalTarget": "元のターゲット:", - "DG.ModifySkillRollDialogue.TargetModifier": "変換:", + "DG.ModifySkillRollDialogue.TargetModifier": "変換(+/-):", "DG.ModifySkillRollDialogue.ModifierTooltip": "スキルチェックのターゲットに加算/減算します。", "DG.ModifyDamageRollDialogue.Weapon": "武器:", From 686cd77ef8f900d007b3548b00f2bd7dafc5b5be Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 13 Mar 2021 00:24:10 -0800 Subject: [PATCH 4/6] added localization for new macros --- module/deltagreen.js | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/module/deltagreen.js b/module/deltagreen.js index 9ee2a76..0b58375 100644 --- a/module/deltagreen.js +++ b/module/deltagreen.js @@ -13,6 +13,7 @@ Hooks.once('init', async function() { DeltaGreenActor, DeltaGreenItem, rollItemMacro, + rollItemSkillCheckMacro, rollSkillMacro }; @@ -155,6 +156,9 @@ function rollItemMacro(itemName) { let actor; if (speaker.token) actor = game.actors.tokens[speaker.token]; if (!actor) actor = game.actors.get(speaker.actor); + + if(!actor) return ui.notifications.warn('Must have an Actor selected first.'); + const item = actor ? actor.items.find(i => i.name === itemName) : null; if (!item) return ui.notifications.warn(`Your controlled Actor does not have an item named ${itemName}`); @@ -162,6 +166,31 @@ function rollItemMacro(itemName) { return item.roll(); } +function rollItemSkillCheckMacro(itemName) { + const speaker = ChatMessage.getSpeaker(); + let actor; + if (speaker.token) actor = game.actors.tokens[speaker.token]; + if (!actor) actor = game.actors.get(speaker.actor); + + if(!actor) return ui.notifications.warn('Must have an Actor selected first.'); + + const item = actor ? actor.items.find(i => i.name === itemName) : null; + if (!item) return ui.notifications.warn(`Your controlled Actor does not have an item named ${itemName}`); + + let skillName = item.data.data.skill.toString(); + + let skill = actor.data.data.skills[skillName]; + let translatedSkillLabel = ""; + + try{ + translatedSkillLabel = game.i18n.localize("DG.Skills." + skillName) + } + catch{ + translatedSkillLabel = skillName; + } + + sendPercentileTestToChat(actor, translatedSkillLabel, skill.proficiency); +} function rollSkillMacro(skillName) { const speaker = ChatMessage.getSpeaker(); @@ -175,5 +204,14 @@ function rollSkillMacro(skillName) { if(!skill) return ui.notifications.warn('Bad skill name passed to macro.'); - sendPercentileTestToChat(actor, skill.label, skill.proficiency); + let translatedSkillLabel = ""; + + try{ + translatedSkillLabel = game.i18n.localize("DG.Skills." + skillName) + } + catch{ + translatedSkillLabel = skillName; + } + + sendPercentileTestToChat(actor, translatedSkillLabel, skill.proficiency); } \ No newline at end of file From 697b8a31db269a7403f52b87fd44a269534abcce Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 13 Mar 2021 21:41:51 -0800 Subject: [PATCH 5/6] Cthulu Rol sent new translation file --- lang/es.json | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lang/es.json b/lang/es.json index 1a12737..fe6bb4e 100644 --- a/lang/es.json +++ b/lang/es.json @@ -1,10 +1,10 @@ { "DG.SystemName": "Delta Green", - "DG.AgentNameFieldTooltip": "APELLIDO, NOMBRE (Y ALIAS SI CORRESPONDE)", + "DG.AgentNameFieldTooltip": "APELLIDO, NOMBRE (ALIAS O NOMBRE EN CLAVE SI APLICABLE)", "DG.RollLuck": "Tira Suerte", "DG.Luck": "Suerte", - "DG.FallbackText.ProfessionAndOrRank": "PROFESION (RANGO SI CORRESPONDE)", + "DG.FallbackText.ProfessionAndOrRank": "PROFESIÓN (RANGO SI APLICABLE)", "DG.Skills.accounting": "Contabilidad", "DG.Skills.alertness": "Alerta", @@ -13,15 +13,15 @@ "DG.Skills.artillery": "Artillería", "DG.Skills.athletics": "Atletismo", "DG.Skills.bureaucracy": "Burocracia", - "DG.Skills.computer_science": "Informatica", + "DG.Skills.computer_science": "Informática", "DG.Skills.criminology": "Criminología", - "DG.Skills.demolitions": "Explosivos", + "DG.Skills.demolitions": "Demoliciones", "DG.Skills.disguise": "Disfrazarse", "DG.Skills.dodge": "Esquivar", "DG.Skills.drive": "Conducir", "DG.Skills.firearms": "Armas de Fuego", "DG.Skills.first_aid": "Primeros Auxilios", - "DG.Skills.forensics": "Medicina Forense", + "DG.Skills.forensics": "Ciencia Forense", "DG.Skills.heavy_machiner": "Maquinaria Pesada", "DG.Skills.heavy_weapons": "Armas Pesadas", "DG.Skills.history": "Historia", @@ -32,14 +32,14 @@ "DG.Skills.navigate": "Orientarse", "DG.Skills.occult": "Ocultismo", "DG.Skills.persuade": "Persuadir", - "DG.Skills.pharmacy": "Farmacología", + "DG.Skills.pharmacy": "Farmacia", "DG.Skills.psychotherapy": "Psicoterapia", "DG.Skills.ride": "Equitación", "DG.Skills.search": "Buscar", "DG.Skills.sigint": "SIGINT", - "DG.Skills.stealth": "Sigilo", + "DG.Skills.stealth": "Sigilo/Camuflar", "DG.Skills.surgery": "Cirugia", - "DG.Skills.survival": "Supervivemcia", + "DG.Skills.survival": "Supervivencia", "DG.Skills.swim": "Nadar", "DG.Skills.unarmed_combat": "Combate sin Armas", "DG.Skills.unnatural": "Antinatural", @@ -50,8 +50,8 @@ "DG.Skills.SkillName": "Nombre de la Habilidad", "DG.TypeSkills.Art": "Arte", - "DG.TypeSkills.Craft": "Fabricar", - "DG.TypeSkills.ForeignLanguage": "Lengua Extranjera", + "DG.TypeSkills.Craft": "Oficio", + "DG.TypeSkills.ForeignLanguage": "Idioma", "DG.TypeSkills.MilitaryScience": "Ciencia Militar", "DG.TypeSkills.Pilot": "Pilotar", "DG.TypeSkills.Science": "Ciencia", @@ -83,7 +83,7 @@ "DG.Roll.Target": "Objetivo: ", "DG.Roll.Success": "Exito", "DG.Roll.Failure": "Fallo", - "DG.Roll.Critical": "Critico", + "DG.Roll.Critical": "Crítico", "DG.Roll.Lethality": "Letalidad", "DG.Roll.Lethal": "Letal", "DG.Roll.For": "Para", @@ -93,17 +93,17 @@ "DG.Roll.Roll": "Tirar", "DG.Physical.Wounds": "Heridas", - "DG.Physical.FirstAidLabel": "Los Primeros Auxilios Ya Han Sido Aplicados: ", + "DG.Physical.FirstAidLabel": "Los Primeros Auxilios ya han sido aplicados: ", "DG.Generic.AddButtonLabel": "Añadir", - "DG.Mental.BreakingPoint": "Punto Ruptura: ", + "DG.Mental.BreakingPoint": "Punto de Ruptura: ", "DG.Mental.Reset": "Borrar", - "DG.Mental.SanityLossIncidentsLabel": "Incidentes o perdida de COR sin Locura", + "DG.Mental.SanityLossIncidentsLabel": "Incidentes o perdida de COR sin enloquecer", "DG.Mental.Violence": "Violencia", - "DG.Mental.Helplessness": "Impotencia", + "DG.Mental.Helplessness": "Indefensión", "DG.Mental.AdaptedToViolence": "Adaptado a la Violencia", - "DG.Mental.AdaptedToHelplessness": "Adaptado a la Impotencia", + "DG.Mental.AdaptedToHelplessness": "Adaptado a la Indefensión", "DG.Mental.Motivations": "Motivaciones", "DG.Mental.Disorders": "Desordenes", @@ -128,7 +128,7 @@ "DG.CV.EducationPlaceholder": "Educación o Entrenamiento", "DG.CV.PhysicalDescriptionLabel": "Descripción Física/Notas", - "DG.Bonds.Bond": "Vículo", + "DG.Bonds.Bond": "Vínculo", "DG.Bonds.Name": "Nombre", "DG.Bonds.Score": "Puntuación", "DG.Bonds.NewBond": "Nuevo Vínculo", @@ -142,7 +142,7 @@ "DG.Tooltip.HP": "Puntos de Vida, un personaje cae inconsciente a los 2 PV, y muere con 0 PV.", "DG.Tooltip.MaximumHP": "La salud máxima es el promedio de FUE + CON, redondeado hacia arriba.", - "DG.Tooltip.WP": "Los Puntos de Voluntad son el combustible mental. Los agentes requieren puntos de voluntad para seguir adelante a pesar del agotamiento o situaciones mentalmente graves. Consulte la página 47 del Manual del Agente para obtener más detalles.", + "DG.Tooltip.WP": "Los Puntos de Voluntad son el combustible mental. Los agentes requieren puntos de voluntad para seguir adelante a pesar del agotamiento o en situaciones mentalmente graves. Consulte la página 47 del Manual del Agente para obtener más detalles.", "DG.Tooltip.MaximumWP": "Los Ptos Voluntad máximos son iguales al POD.", "DG.Tooltip.SanityLabel": "Click para hacer una tirada de Cordura...", "DG.Tooltip.CurrentSanityPartOne": "Cordura actual, punto de ruptura actual es ", @@ -175,7 +175,7 @@ "DG.ItemWindow.Motivations.MotivationNameTooltip": "Algo que impulsa al personaje. ", "DG.ItemWindow.Motivations.DisorderNameTooltip": "Un trastorno reemplaza una motivación después de llegar al punto de ruptura.", "DG.ItemWindow.Motivations.IsDisorderTooltip": "Marque esta opción si agrega un trastorno o si se ha perdido una motivación existente debido a la adquisición de un trastorno.", - "DG.ItemWindow.Motivations.DisorderHasBeenCured": "El trastorno ha sido \"curado \" ", + "DG.ItemWindow.Motivations.DisorderHasBeenCured": "El trastorno ha sido curado.", "DG.ItemWindow.Motivations.DisorderHasBeenCuredTooltip": "Un éxito crítico en una tirada de suerte terapéutica puede curar un trastorno. Sin embargo, puede regresar la próxima vez que se alcance un punto de ruptura. ", "DG.ItemWindow.Gear.Attributes": "Atributos", @@ -207,7 +207,7 @@ "DG.ModifySkillRollDialogue.Title": "Modificar Tirada", "DG.ModifySkillRollDialogue.Test": "Test:", "DG.ModifySkillRollDialogue.OriginalTarget": "Objetivo Original:", - "DG.ModifySkillRollDialogue.TargetModifier": "Modificar Objetivo (+/-):", + "DG.ModifySkillRollDialogue.TargetModifier": "Modificar Objetivo:", "DG.ModifySkillRollDialogue.ModifierTooltip": "Dar un modificador positivo o negativo aquí para sumar o restar al objetivo en la chequeo de habilidades.", "DG.ModifyDamageRollDialogue.Weapon": "Arma:", From 10d19386f2e5ea8fc355ade94ccf2b42f9685b47 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 13 Mar 2021 22:08:04 -0800 Subject: [PATCH 6/6] reverted system.json file to previous value --- system.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system.json b/system.json index a56b6a4..af1e0c2 100644 --- a/system.json +++ b/system.json @@ -1,6 +1,6 @@ { "name": "deltagreen", - "title": "Delta Green (Unofficial) fork", + "title": "Delta Green (Unofficial)", "description": "Fan-made Foundry VTT system for Delta Green: The Role Playing Game for Foundry VTT. Based on the rules in the Agent's Handbook (https://www.drivethrurpg.com/product/181674/Delta-Green-Agents-Handbook). Made with the permission of but neither affiliated with nor endorsed by Arc Dream Publishing or the Delta Green Partnership.", "version": "0.9.7", "minimumCoreVersion": "0.6.2", @@ -57,8 +57,8 @@ "gridUnits": "m", "primaryTokenAttribute": "health", "secondaryTokenAttribute": "wp", - "url": "https://github.com/uriele/delta-green-foundry-vtt-system-unofficial", - "manifest": "https://github.com/uriele/delta-green-foundry-vtt-system-unofficial/raw/master/system.json", - "download": "https://github.com/uriele/delta-green-foundry-vtt-system-unofficial/archive/v0.9.7.zip", + "url": "https://github.com/TheLastScrub/delta-green-foundry-vtt-system-unofficial", + "manifest": "https://github.com/TheLastScrub/delta-green-foundry-vtt-system-unofficial/raw/master/system.json", + "download": "https://github.com/TheLastScrub/delta-green-foundry-vtt-system-unofficial/archive/v0.9.7.zip", "license": "LICENSE.txt" }