From 01dec1d5245b899a10713cf2615dbf425f0c4800 Mon Sep 17 00:00:00 2001 From: HavelockV Date: Thu, 17 Sep 2020 16:08:01 +0200 Subject: [PATCH 1/8] Oragnization - Organization --- templates/actors/character-sheet.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/actors/character-sheet.html b/templates/actors/character-sheet.html index 8ace3912..a70cc7b5 100644 --- a/templates/actors/character-sheet.html +++ b/templates/actors/character-sheet.html @@ -14,7 +14,7 @@
- +
{{/if}} From 5fc3d1f38acfb632c4214bb1aa7a78fead5a8558 Mon Sep 17 00:00:00 2001 From: HavelockV Date: Thu, 17 Sep 2020 17:11:08 +0200 Subject: [PATCH 2/8] Penalty/malus, bullets calc correction --- README.md | 4 ++++ lang/en.json | 2 +- module/chat/rangecombat.js | 8 +++---- templates/chat/combat/melee-target.html | 2 +- templates/chat/combat/range-initiator.html | 26 +++++++++++----------- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 27e31f9e..36a457e3 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ Compendium 'Weapons' contains a single test weapon. ## What is working +version 0.3.7 : + +* Bug correction typo on the character sheet. + version 0.3.6 : * Addition of pulp talents (To be tested, I’m not familiar with Pulp Cthulhu, all of this is mainly cosmetic, no automation implemented so far) diff --git a/lang/en.json b/lang/en.json index 42a7b95d..3c6afb88 100644 --- a/lang/en.json +++ b/lang/en.json @@ -136,7 +136,7 @@ "CoC7.Advantage": "Advantage", "CoC7.Disadvantage": "Disadvantage", "CoC7.TitleAdvantage": "Add 1 bonus die (target is prone, restrained...)", -"CoC7.TitleDisadvantage": "Add 1 malus die (for being prone, restrained...)", +"CoC7.TitleDisadvantage": "Add 1 panalty die (for being prone, restrained...)", "CoC7.TitleOutNumbered":"Add 1 bonus dice for outnumbered target", "CoC7.TitleSurprised": "Add 1 bonus dice for surprised target", "CoC7.TitleAutoSuccess": "Attack automaticaly hit", diff --git a/module/chat/rangecombat.js b/module/chat/rangecombat.js index 8df500a6..fb3b1c90 100644 --- a/module/chat/rangecombat.js +++ b/module/chat/rangecombat.js @@ -413,8 +413,8 @@ export class CoC7RangeInitiator{ let weaponMalfunction = false; let index = 0; while( !weaponMalfunction && this.shots.length > index){ - const roll = this.shootAtTarget(this.shots[index]); - await this.weapon.shootBullets( this.shots[index].bulletsShot + this.shots[index].transitBullets ); + const roll = this.shootAtTarget( this.shots[index]); + await this.weapon.shootBullets( parseInt(this.shots[index].bulletsShot) + parseInt(this.shots[index].transitBullets)); if( roll.hasMalfunction){ roll.isSuccess = false; weaponMalfunction = true; @@ -770,8 +770,8 @@ export class CoC7RangeTarget{ get sizeText(){ if( this.big) return '1 bonus die for big target (Build > +4)'; - if( this.small) return '1 malus die for a small target'; - return 'Target has a normal size, no bonus/malus'; + if( this.small) return '1 penalty die for a small target'; + return 'Target has a normal size, no bonus/penalty'; } get sizeLabel(){ diff --git a/templates/chat/combat/melee-target.html b/templates/chat/combat/melee-target.html index 2e32d3b3..398121a6 100644 --- a/templates/chat/combat/melee-target.html +++ b/templates/chat/combat/melee-target.html @@ -71,7 +71,7 @@

data-flag="advantage" data-selected={{advantage}}>{{localize 'CoC7.Advantage'}} {{localize 'CoC7.Disadvantage'}} diff --git a/templates/chat/combat/range-initiator.html b/templates/chat/combat/range-initiator.html index f182ee93..135e0009 100644 --- a/templates/chat/combat/range-initiator.html +++ b/templates/chat/combat/range-initiator.html @@ -46,7 +46,7 @@

{{#if burst}} {{localize 'CoC7.rangeCombatCard.Burst'}}{{/if}} {{#if fullAuto}} {{localize 'CoC7.rangeCombatCard.FullAuto'}} {{/if}} {{#if advantage}} {{localize 'CoC7.Advantage'}}{{/if}} - {{#if disadvantage}} {{localize 'CoC7.Disadvantage'}}{{/if}} + {{#if disadvantage}} {{localize 'CoC7.Disadvantage'}}{{/if}} {{#if aimed}} {{localize 'CoC7.rangeCombatCard.aiming'}}{{/if}} {{else}} @@ -95,7 +95,7 @@

data-flag="advantage" data-selected={{advantage}}>{{localize 'CoC7.Advantage'}} {{localize 'CoC7.Disadvantage'}} @@ -161,7 +161,7 @@

title="{{localize 'CoC7.rangeCombatCard.OutOfRange'}}" >{{localize 'CoC7.rangeCombatCard.OutOfRange'}} {{localize 'CoC7.rangeCombatCard.Cover'}} title="1 bonus die for big target (Build > +4)" >{{localize 'CoC7.rangeCombatCard.BigTarget'}} {{localize 'CoC7.combatCard.SmallTarget'}} {{localize 'CoC7.rangeCombatCard.InMelee'}} {{localize 'CoC7.rangeCombatCard.FastMovingTarget'}} {{else}}
@@ -202,7 +202,7 @@

{{localize 'CoC7.rangeCombatCard.Cover'}} @@ -230,12 +230,12 @@

{{trgt.sizeLabel}} {{localize 'CoC7.rangeCombatCard.InMelee'}} {{localize 'CoC7.rangeCombatCard.FastMovingTarget'}} @@ -258,7 +258,7 @@

title="{{localize 'CoC7.rangeCombatCard.OutOfRange'}}" >{{localize 'CoC7.rangeCombatCard.OutOfRange'}} {{localize 'CoC7.rangeCombatCard.Cover'}} title="1 bonus die for big target (Build > +4)" >{{localize 'CoC7.rangeCombatCard.BigTarget'}} {{localize 'CoC7.combatCard.SmallTarget'}} {{localize 'CoC7.rangeCombatCard.InMelee'}} {{localize 'CoC7.rangeCombatCard.FastMovingTarget'}}

From 1227b17a46c2c6482968459c6d8cb5c3220a8014 Mon Sep 17 00:00:00 2001 From: "Jose E. Lozano" Date: Thu, 17 Sep 2020 19:00:55 +0200 Subject: [PATCH 3/8] Spanish language file updated to 0.3.6 --- lang/es.json | 104 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 32 deletions(-) diff --git a/lang/es.json b/lang/es.json index a06c8e88..2ba61a8c 100644 --- a/lang/es.json +++ b/lang/es.json @@ -19,19 +19,21 @@ "CHARAC.Education": "Educación", "CoC7.Name": "Nombre", +"CoC7.Archetype": "Arquetipo", "CoC7.Occupation": "Ocupación", "CoC7.Age": "Edad", "CoC7.Sex": "Género", "CoC7.Residence": "Residencia", -"CoC7.Birthplace": "Lugar de nacimiento", -"CoC7.HitPoints": "Puntos de vida", +"CoC7.Birthplace": "Nacimiento", +"CoC7.Organization": "Organización", +"CoC7.HitPoints": "Puntos de vida", "CoC7.HP": "PV", "CoC7.MagicPoints": "Puntos de magia", "CoC7.MP": "PM", "CoC7.SanityPoints": "Puntos de cordura", "CoC7.Sanity": "Cordura", "CoC7.SAN": "COR", -"CoC7.DailySanLoss": "Pérdida de cordura diaria :", +"CoC7.DailySanLoss": "Pérdida diaria de COR :", "CoC7.Luck": "Suerte", "CoC7.Movement": "Movimiento", "CoC7.Mov": "Mov", @@ -44,6 +46,7 @@ "CoC7.Background": "Trasfondo", "CoC7.Notes": "Notas", "CoC7.DailySanIconOver": "Reiniciar", +"CoC7.Prone": "Caído", "CoC7.Unconsious": "Inconsciente", "CoC7.CriticalWounds": "Herida grave", "CoC7.Dying": "Moribundo", @@ -79,7 +82,7 @@ "CoC7.Dice": "Dados", "CoC7.DiceModifierBonus": "bonificación", "CoC7.DiceModifierPenalty": "penalización", -"CoC7.BonusDice": "Dados de Bonificación", +"CoC7.BonusDice": "Dados de bonificación", "CoC7.UnitsDie": "1 dado de unidades", "CoC7.TensDie": "dado de decenas", "CoC7.TensDice": "dado(s) de decenas", @@ -93,27 +96,28 @@ "CoC7.LuckError": "{actorName} no tiene suficiente Suerte para superar la tirada", "CoC7.check.AutoSuccess": "Éxito Autom.", "CoC7.check.AutoFailure": "Fallo Autom.", -"CoC7.check.RevealCheck": "Desvelar resultado", +"CoC7.check.RevealCheck": "Mostrar tirada", "CoC7.check.ForcePass": "Forzar éxito", "CoC7.check.ForceFail": "Forzar fallo", "CoC7.check.FlagForDevelopment": "Premiar experiencia", "CoC7.check.IncreaseSuccessLevel": "Incrementar nivel de éxito", "CoC7.check.DecreaseSuccessLevel": "Disminuir nivel de éxito", -"CoC7.BonusSelectionWindow": "Ventana de selección de bonificación", +"CoC7.BonusSelectionWindow": "Seleccionar dificultad y bonificación", +"CoC7.SkillDetailsWindow" : "Ventana de detalles de la habilidad", "CoC7.RegularDifficulty": "normal", "CoC7.HardDifficulty": "difícil", "CoC7.ExtremeDifficulty": "extrema", "CoC7.CriticalDifficulty": "crítica", "CoC7.UnknownDifficulty": "desconocida", -"CoC7.RollDifficulty": "Dificultad de la Tirada", -"CoC7.RollDifficultyUnknown": "Ciega", +"CoC7.RollDifficulty": "Dificultad de la tirada", +"CoC7.RollDifficultyUnknown": "Desconocida", "CoC7.RollDifficultyRegular": "Normal", "CoC7.RollDifficultyHard": "Difícil", "CoC7.RollDifficultyExtreme": "Extrema", "CoC7.RollDifficultyCritical": "Crítica", "CoC7.RollResult.LuckSpendText": "{luckAmount} puntos de Suerte gastados, {successLevel} superado", -"CoC7.RollDice": "Tirar !", +"CoC7.RollDice": "¡Tirar dados!", "CoC7.SuccesLevelHint": "{value} nivel(es) de éxito", "CoC7.FailureLevelHint": "Fallo por {value} nivel(es)", @@ -133,9 +137,13 @@ "CoC7.Disadvantage": "Desventaja", "CoC7.TitleAdvantage": "Añadir 1 dado de bonificación (el objetivo está boca abajo, inmovilizado...)", "CoC7.TitleDisadvantage": "Añadir 1 dado de penalización (por estar boca abajo, inmovilizado...)", -"CoC7.TitleOutNumbered":"Añadir 1 dado de bonificación por objetivo en inferioridad numérica", +"CoC7.TitleOutNumbered": "Añadir 1 dado de bonificación por objetivo en inferioridad numérica", "CoC7.TitleSurprised": "Añadir 1 dado de bonificación por objetivo sorprendido", "CoC7.TitleAutoSuccess": "El ataque impacta automáticamente", +"CoC7.WinnerRollDamage": "{name} ha ganado. Tirar daño.", +"CoC7.NoWinner": "Ambas partes han fallado.", +"CoC7.DodgeSuccess": "{name} ha esquivado!", +"CoC7.ManeuverSuccess": "La maniobra de {name} ha tenido éxito.", "CoC7.combatCard.dive4cover": "Ponerse a Cubierto", @@ -153,7 +161,9 @@ "CoC7.combatCard.SmallTarget": "Objetivo pequeño", "CoC7.rangeCombatCard.FastMovingTarget": "Objetivo rápido", "CoC7.rangeCombatCard.InMelee": "En combate cuerpo a cuerpo", -"CoC7.rangeCombatCard.aiming": "Apuntar", +"CoC7.rangeCombatCard.aiming": "Apuntando", +"CoC7.rangeCombatDamage" : "{name} recibe {total} puntos de daño", + "CoC7.DropZone": "DropZone", "CoC7.SkillValue": "Valor", @@ -167,10 +177,10 @@ "CoC7.WeaponDamage": "Daño", "CoC7.Weapon.BlastRadius": "Radio de explosión", "CoC7.WeaponMalfunction": "Avería", -"CoC7.WeaponUsesPerRound": "Usos/Asalto", -"CoC7.WeaponSheet.RoundsPerUse.Info": "Número de asaltos necesarios para preparar el arma para disparar", -"CoC7.WeaponMax": "Máx usos/Asalto", -"CoC7.BurstSize": "Bálas/ráfaga", +"CoC7.WeaponUsesPerRound": "Usos/asalto", +"CoC7.WeaponSheet.RoundsPerUse.Info": "Número de asaltos de preparación necesarios para disparar el arma de nuevo", +"CoC7.WeaponMax": "Máx. usos/asalto", +"CoC7.BurstSize": "Balas/ráfaga", "CoC7.WeaponBulletsInMag": "Cargador", "CoC7.WeaponSpecial": "Especial", "CoC7.ItemPrice": "Precio", @@ -193,8 +203,9 @@ "CoC7.SkillFirearm": "Armas de fuego", "CoC7.WeaponRngd": "Alcance", +"CoC7.WeaponProperyManeuver": "Maniobra", "CoC7.WeaponTouch": "Toque", -"CoC7.WeaponImpl": "Empalar", +"CoC7.WeaponImpl": "Empala", "CoC7.WeaponRare": "Rara", "CoC7.WeaponAhdb": "+BD/2", "CoC7.WeaponAddb": "+BD", @@ -209,8 +220,9 @@ "CoC7.WeaponStun": "Aturdimiento", "CoC7.Weapon.Property.Melee": "Cuerpo a cuerpo", "CoC7.Weapon.Property.Thrown": "Arrojadiza", -"CoC7.Weapon.Property.Burn": "Quemadura", -"CoC7.Weapon.Property.Shotgun": "Escopeta", +"CoC7.Weapon.Property.Burn": "Fuego", +"CoC7.Weapon.Property.Shotgun": "Arma de fuego", + "CoC7.ErrorItem": "No se pudo localizar el ítem", "CoC7.ErrorActor": "No se pudo localizar al actor", @@ -227,14 +239,14 @@ "CoC7.NewSkillName": "nueva habilidad", "CoC7.AddSkill": "Añadir habilidad", "CoC7.DevelopemmentPhase": "Fase de Desarrollo", -"CoC7.SkillCantGainXp": "La habilidad no puede ganar EXP", +"CoC7.SkillCantGainXp": "Esta habilidad no se puede marcar para desarrollo", "CoC7.SkillUnflagForDevelopement": "Desmarcar para desarrollo", "CoC7.SkillFlagForDevelopement": "Marcar para desarrollo", "CoC7.SkillDetail": "Detalles", "CoC7.EditSkill": "Editar habilidad", "CoC7.DeleteSkill": "Eliminar habilidad", -"CoC7.RangeSkills": "Habilidades de Combate a Distancia", -"CoC7.MeleeSkills": "Habilidades de Combate Cuerpo a Cuerpo", +"CoC7.RangeSkills": "Habilidades de combate a distancia", +"CoC7.MeleeSkills": "Habilidades de combate cuerpo a cuerpo", "CoC7.NewItemName": "nuevo ítem", "CoC7.AddItem": "Añadir ítem", "CoC7.EditItem": "Editar ítem", @@ -247,7 +259,8 @@ "CoC7.RangeWeapons": "Armas a distancia", "CoC7.WeaponName": "Nombre", "CoC7.WeaponSkill": "Habilidad", -"CoC7.WeaponSkillAlt": "Habilidades alternativas", +"CoC7.WeaponSkillAlt": "Hab. alternativa", +"CoC7.Inventory": "Inventario", "CoC7.ManualCreditValues": "Crédito manual", @@ -276,12 +289,12 @@ "CoC7.CthuluMythosInitial": "Mitos de Cthulhu Inicial", "CoC7.CMF": "MCC", "CoC7.CthuluMythosFinal": "Mitos de Cthulhu Completo", -"CoC7.Occult": "Ocultismo", +"CoC7.Occult": "Ciencias ocultas", "CoC7.MythosRating": "Puntuación de Mitos", "CoC7.StudyTime": "Tiempo de Estudio", "CoC7.SpellCastingTime": "Tiempo de ejecución", "CoC7.SpellCastingCost": "Coste", -"CoC7.CallSpell": "Llamar", +"CoC7.CallSpell": "Llamada", "CoC7.DismissSpell": "Expulsión", "CoC7.ContactSpell": "Contacto", "CoC7.SummonSpell": "Convocación", @@ -293,15 +306,42 @@ "CoC7.BookType": "Tipo de Libro", "CoC7.MythosBook": "Tomo de los Mitos", "CoC7.OccultBook": "Libro de Ocultismo", -"CoC7.Unidentified": "Descripción no identificada", +"CoC7.Unidentified": "Sin identificar", + +"CoC7.PulpTalents": "Talentos Pulp", +"CoC7.TalentType": "Tipo de talento", +"CoC7.PhysicalTalent": "Físicos", +"CoC7.MentalTalent": "Mentales", +"CoC7.CombatTalent": "De combate", +"CoC7.MiscellaneousTalent": "Varios", +"CoC7.BasicTalent": "Básicos", +"CoC7.InsaneTalent": "De locura", +"CoC7.OtherTalent": "Otros", + +"CoC7.Items": "Objetos", +"CoC7.Books": "Tomos", +"CoC7.PutGunAway": "Bajar el arma", +"CoC7.DrawGun": "Desenfundar el arma", -"SETTINGS.DefaultDifficulty": "Nivel de dificultad predeterminado", -"SETTINGS.DefaultDifficultyHint": "Puedes indicar el nivel de dificultad predeterminado de las tiradas. Dificultad desconocida lanzará tiradas sin que el jugador conozca la dificultad.", -"SETTINGS.CheckDifficultyRegular": "Dificultad predeterminada", +"SETTINGS.DefaultDifficulty": "Dificultad por defecto", +"SETTINGS.DefaultDifficultyHint": "Puedes indicar la dificultad por defecto de las tiradas. Desconocida lanzará tiradas sin que el jugador conozca la dificultad.", +"SETTINGS.CheckDifficultyRegular": "Dificultad por defecto", "SETTINGS.CheckDifficultyUnknown": "Dificultad desconocida", -"SETTINGS.UseToken": "Usar imagen del token", -"SETTINGS.UseTokenHint": "Usar la imagen del token en lugar de los retratos en las tarjetas del chat", -"SETTINGS.DisplayActorOnCard": "Mostrar actor en tarjeta", -"SETTINGS.DisplayActorOnCardHint": "Mostrar la imagen/token del actor en las tarjetas de chat de combate" +"SETTINGS.UseToken": "Usar imagen del icono", +"SETTINGS.UseTokenHint": "Usar la imagen del icono en lugar de los retratos en las cartas del chat", +"SETTINGS.DisplayActorOnCard": "Mostrar actor en carta", +"SETTINGS.DisplayActorOnCardHint": "Mostrar la imagen/icono del actor en las cartas de chat de combate", +"SETTINGS.InitiativeRule": "Mecánica de cálculo de iniciativa", +"SETTINGS.InitiativeRuleHint": "Puedes elegir entre la iniciativa básica (valores de DES) o la regla opcional (tirada de DES)", +"SETTINGS.InitiativeRuleBasic": "Básica", +"SETTINGS.InitiativeRuleOptional": "Opcional", +"SETTINGS.displayInitDices": "Mostrar dado de iniciativa", +"SETTINGS.displayInitDicesHint": "Mostrar los dados cuando se tire iniciativa (solo cuando se usa la regla opcional)", +"SETTINGS.PulpRules" : "PV Pulp", +"SETTINGS.PulpRulesHint" : "Usar las reglas de Pulp para el cálculo de los PV", +"SETTINGS.DisregardAmmo": "Ignorar la munición.", +"SETTINGS.DisregardAmmoHint": "Al activar esta opción no se tendrán en cuenta la munición cargada en el arma a la hora de disparar.", +"SETTINGS.DisregardUsePerRound": "Ignorar el número de usos por asalto.", +"SETTINGS.DisregardUsePerRoundHint": "Al activar esta opción, se podrá disparar sin restricciones, ignorando el número de disparos que un arma puede realizar por asalto." } From d8878ddf99d7859d5e1dd85cca1b8bd9671403cb Mon Sep 17 00:00:00 2001 From: HavelockV Date: Sat, 19 Sep 2020 05:18:24 +0200 Subject: [PATCH 4/8] Distance measurement corrections --- README.md | 10 +++++++++- lang/en.json | 4 +++- module/chat/helper.js | 8 +++++--- module/chat/rangecombat.js | 14 +++++++++++--- module/coc7.js | 8 ++++++++ templates/chat/combat/range-initiator.html | 8 ++++---- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 36a457e3..40342da4 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,15 @@ Compendium 'Weapons' contains a single test weapon. version 0.3.7 : -* Bug correction typo on the character sheet. +* Bug correction: + * Typo on the character sheet. + * Typo correction on the range chat-card. + * Typo correction malus->penalty. + * Calculation of bullets fired was wrongly deducted from the weapon magazine. +* Added distance to target on the range chat-card. + * You can now see the distance from the taget below the target selector in the chat-card and on the tooltip of the target. +* Added an option to restrict measurement to grid space. + * By default, for combat range calculation, the distance measured is the euclidean distance. To see that distance using the ruller you'll need to hold shift while measuring. An option is added to use grid spaces instead of euclidean distance. By selecting it, distance will be calculated as per the default ruler for that grid type (Grid less; Square, Hex...) version 0.3.6 : diff --git a/lang/en.json b/lang/en.json index 3c6afb88..45dd0c61 100644 --- a/lang/en.json +++ b/lang/en.json @@ -343,5 +343,7 @@ "SETTINGS.DisregardAmmo": "Disregard Ammo count.", "SETTINGS.DisregardAmmoHint": "Enabling this will not take in account the number of bullets loaded in the gun.", "SETTINGS.DisregardUsePerRound": "Disregard Uses per Rounds.", -"SETTINGS.DisregardUsePerRoundHint": "Enabling this will allow you to fire as much as you want, regardless of the uses per round of the weapon." +"SETTINGS.DisregardUsePerRoundHint": "Enabling this will allow you to fire as much as you want, regardless of the uses per round of the weapon.", +"SETTINGS.RestrictGridSpaces": "Restrict measurement to grid spaces", +"SETTINGS.RestrictGridSpacesHint": "For range combat, if selected the distances will be mesured in grid spaces, if not the 'real' (euclidean) distance will be used." } diff --git a/module/chat/helper.js b/module/chat/helper.js index 744f26fe..b42f0597 100644 --- a/module/chat/helper.js +++ b/module/chat/helper.js @@ -104,10 +104,12 @@ export class chatHelper{ static getDistance( startToken, endToken){ const ray = new Ray( startToken.center, endToken.center); + const segment = [{ray}]; const distance = { - gridUnit: ray.distance/game.scenes.active.data.grid, - value: (ray.distance/game.scenes.active.data.grid)*game.scenes.active.data.gridDistance, - unit: game.scenes.active.data.gridUnits + gridUnit: ray.distance/canvas.scene.data.grid, + // value: (ray.distance/canvas.scene.data.grid)*canvas.scene.data.gridDistance, + value: canvas.grid.measureDistances(segment, {gridSpaces:game.settings.get('CoC7', 'gridSpaces')})[0], + unit: canvas.scene.data.gridUnits }; return distance; } diff --git a/module/chat/rangecombat.js b/module/chat/rangecombat.js index fb3b1c90..fd431e3a 100644 --- a/module/chat/rangecombat.js +++ b/module/chat/rangecombat.js @@ -52,7 +52,8 @@ export class CoC7RangeInitiator{ this._targets.forEach( t =>{ if( t.token && this.token){ t.distance = chatHelper.getDistance( t.token, this.token); - const distInYd = chatHelper.toYards( t.distance); + t.distance.rounded = Math.round(t.distance.value * 100)/100; + const distInYd = Math.round(chatHelper.toYards( t.distance)* 100)/100; if( distInYd){ if( this.actor){ t.pointBlankRange = false; @@ -730,11 +731,17 @@ export class CoC7RangeTarget{ this._big = false; this._small = false; } + + get isFast(){ + if( this.actor && this.actor.mov) return this.actor.mov >= 8; + return false; + } get fast(){ if( undefined === this._fast){ - if( this.actor && this.actor.mov) this._fast = this.actor.mov >= 8; - else this._fast = false; + // if( this.actor && this.actor.mov) this._fast = this.actor.mov >= 8; + // else this._fast = false; + this._fast = false; } return this._fast; } @@ -835,5 +842,6 @@ export class CoC7RangeTarget{ else this.small = true; } else this[flag] = !this[flag]; + if( 'fast' === flag && this.fast && !this.isFast) ui.notifications.warn( `Fast selected on a target with less than 8 MOV. (MOV: ${this.actor.mov})`); } } \ No newline at end of file diff --git a/module/coc7.js b/module/coc7.js index dd1747b9..d8045da1 100644 --- a/module/coc7.js +++ b/module/coc7.js @@ -39,6 +39,14 @@ Hooks.once('init', async function() { CONFIG.Item.entityClass = CoC7Item; Combat.prototype.rollInitiative = rollInitiative; + game.settings.register('CoC7', 'gridSpaces', { + name: 'SETTINGS.RestrictGridSpaces', + hint: 'SETTINGS.RestrictGridSpacesHint', + scope: 'world', + config: true, + default: false, + type: Boolean + }); game.settings.register('CoC7', 'pulpRules', { name: 'SETTINGS.PulpRules', diff --git a/templates/chat/combat/range-initiator.html b/templates/chat/combat/range-initiator.html index 135e0009..604ff454 100644 --- a/templates/chat/combat/range-initiator.html +++ b/templates/chat/combat/range-initiator.html @@ -114,9 +114,9 @@

{{#each targets as |trgt key|}}
{{#if trgt.active}} - {{trgt.name}} + {{trgt.name}} {{else}} - {{trgt.name}} + {{trgt.name}} {{/if}}
{{/each}} @@ -143,7 +143,7 @@

data-is-blind="false" {{#unless trgt.active}}style='display: none;'{{/unless}}>
- +
@@ -345,7 +345,7 @@

data-bullets-shot="{{shot.bulletsShot}}" data-transit-bullets="{{shot.transitBullets}}" data-transit="{{shot.transit}}"> - ({{key}})Shoot {{shot.bulletsShot}} {{#if shot.transit}}+ {{shot.transitBullets}}{{/if}} bullets at target {{shot.actorName}}. + ({{key}})Shot {{shot.bulletsShot}} {{#if shot.transit}}+ {{shot.transitBullets}}{{/if}} bullets at target {{shot.actorName}}.

{{/each}} From 5daf8d2b654aed47897b8cf98be333f6ede94ff9 Mon Sep 17 00:00:00 2001 From: HavelockV Date: Sat, 19 Sep 2020 05:22:31 +0200 Subject: [PATCH 5/8] 0.3.7 readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 40342da4..940e58f9 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,13 @@ version 0.3.7 : * Typo correction on the range chat-card. * Typo correction malus->penalty. * Calculation of bullets fired was wrongly deducted from the weapon magazine. +* On the range chat-card, the fast option is not default anymore. + * When targeting a target with MOV of 8+, the fast option will not be selected by default. Instead, selecting fast for a target with MOV less thant 8 will trigger a warning. You will still be able to select it. * Added distance to target on the range chat-card. * You can now see the distance from the taget below the target selector in the chat-card and on the tooltip of the target. * Added an option to restrict measurement to grid space. * By default, for combat range calculation, the distance measured is the euclidean distance. To see that distance using the ruller you'll need to hold shift while measuring. An option is added to use grid spaces instead of euclidean distance. By selecting it, distance will be calculated as per the default ruler for that grid type (Grid less; Square, Hex...) +* Spanish translation updated thanks to Lozalojo. version 0.3.6 : From c3cb0e2eec24fcc07910c79b385a8690d492e2f9 Mon Sep 17 00:00:00 2001 From: HavelockV Date: Sat, 19 Sep 2020 05:26:40 +0200 Subject: [PATCH 6/8] Readme 0.3.7 --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 940e58f9..e67fd309 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,12 @@ version 0.3.7 : * Typo correction malus->penalty. * Calculation of bullets fired was wrongly deducted from the weapon magazine. * On the range chat-card, the fast option is not default anymore. - * When targeting a target with MOV of 8+, the fast option will not be selected by default. Instead, selecting fast for a target with MOV less thant 8 will trigger a warning. You will still be able to select it. + * When targeting a target with MOV of 8+, the fast option will not be selected by default. Instead, selecting fast for a target with MOV less than 8 will trigger a warning. You will still be able to select it. * Added distance to target on the range chat-card. - * You can now see the distance from the taget below the target selector in the chat-card and on the tooltip of the target. + * Distance are calculated center of token to center of token. This may have an incidence on what the ruler display if for example your token is 2x2 on a square grid (in that case you can't put the ruler end on the center of the token). + * You can now see the distance from the target below the target selector in the chat-card and on the tool-tip of the target. * Added an option to restrict measurement to grid space. - * By default, for combat range calculation, the distance measured is the euclidean distance. To see that distance using the ruller you'll need to hold shift while measuring. An option is added to use grid spaces instead of euclidean distance. By selecting it, distance will be calculated as per the default ruler for that grid type (Grid less; Square, Hex...) + * By default, for combat range calculation, the distance measured is the euclidean distance. To see that distance using the ruler you'll need to hold shift while measuring. An option is added to use grid spaces instead of euclidean distance. By selecting it, distance will be calculated as per the default ruler for that grid type (Grid less; Square, Hex...) * Spanish translation updated thanks to Lozalojo. version 0.3.6 : From f46f33709570b233a52297f8538c414ddd96c6ca Mon Sep 17 00:00:00 2001 From: HavelockV Date: Sat, 19 Sep 2020 05:28:21 +0200 Subject: [PATCH 7/8] Readme 0.3.7 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e67fd309..c229cb39 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ version 0.3.7 : * On the range chat-card, the fast option is not default anymore. * When targeting a target with MOV of 8+, the fast option will not be selected by default. Instead, selecting fast for a target with MOV less than 8 will trigger a warning. You will still be able to select it. * Added distance to target on the range chat-card. - * Distance are calculated center of token to center of token. This may have an incidence on what the ruler display if for example your token is 2x2 on a square grid (in that case you can't put the ruler end on the center of the token). + * Distance are calculated center of token to center of token. This may have an incidence on what the ruler displays if, for example, your token is 2x2 on a square grid (in that case you can't put the ruler end on the center of the token). * You can now see the distance from the target below the target selector in the chat-card and on the tool-tip of the target. * Added an option to restrict measurement to grid space. * By default, for combat range calculation, the distance measured is the euclidean distance. To see that distance using the ruler you'll need to hold shift while measuring. An option is added to use grid spaces instead of euclidean distance. By selecting it, distance will be calculated as per the default ruler for that grid type (Grid less; Square, Hex...) From 8b100205a03b29caca87c046e805d1d0dd773728 Mon Sep 17 00:00:00 2001 From: HavelockV Date: Sat, 19 Sep 2020 05:37:21 +0200 Subject: [PATCH 8/8] 0.3.7 --- system.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system.json b/system.json index 6973e93d..513b5a58 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "CoC7", "title": "The Call of Cthulhu 7th edition", "description": "The Call of Cthulhu 7th edition simple game system", - "version": "0.3.6", + "version": "0.3.7", "author": "HavelockV", "minimumCoreVersion": "0.5.2", "compatibleCoreVersion": "0.6.6", @@ -72,6 +72,6 @@ "secondaryTokenAttribute": "power", "url": "https://github.com/HavlockV/CoC7-FoundryVTT/", "manifest": "https://github.com/HavlockV/CoC7-FoundryVTT/raw/master/system.json", - "download": "https://github.com/HavlockV/CoC7-FoundryVTT/archive/0.3.6.zip" + "download": "https://github.com/HavlockV/CoC7-FoundryVTT/archive/0.3.7.zip" } \ No newline at end of file