Skip to content

Commit

Permalink
Merge pull request #153 from HavlockV/develop
Browse files Browse the repository at this point in the history
0.3.7
  • Loading branch information
HavlockV authored Sep 19, 2020
2 parents f22bb83 + 8203280 commit 3ee52e8
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 65 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ Compendium 'Weapons' contains a single test weapon.

## What is working

version 0.3.7 :

* 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.
* 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 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...)
* Spanish translation updated thanks to Lozalojo.

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)
Expand Down
6 changes: 4 additions & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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."
}
104 changes: 72 additions & 32 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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)",

Expand All @@ -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",

Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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."
}
8 changes: 5 additions & 3 deletions module/chat/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
22 changes: 15 additions & 7 deletions module/chat/rangecombat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -413,8 +414,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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -770,8 +777,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(){
Expand Down Expand Up @@ -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})`);
}
}
8 changes: 8 additions & 0 deletions module/coc7.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}

2 changes: 1 addition & 1 deletion templates/actors/character-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<input name="data.infos.archetype" type="text" value="{{data.infos.archetype}}"/>
</div>
<div class="form-group">
<label>{{ localize 'CoC7.Oragnization' }} :</label>
<label>{{ localize 'CoC7.Organization' }} :</label>
<input name="data.infos.organization" type="text" value="{{data.infos.organization}}"/>
</div>
{{/if}}
Expand Down
Loading

0 comments on commit 3ee52e8

Please sign in to comment.