Skip to content

Commit

Permalink
Merge pull request #66 from HavlockV/develop
Browse files Browse the repository at this point in the history
0.2.4
  • Loading branch information
HavlockV authored Aug 14, 2020
2 parents 61f6a41 + 5332b64 commit 5b11b4c
Show file tree
Hide file tree
Showing 22 changed files with 436 additions and 112 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ Compendium 'Weapons' contains a single test weapon.

## What is working

version 0.2.4 :

* Range combat supports shotguns.
* Bug correction (spending luck on luck and SAN rolls no more possible).
* Slight range combat refactoring (more to come at a later stage. Aim is to reduce size and number of cards).
* Additions of icons to the cards.
* Bonus, penalties, target response have been moved to the card tooltip once the card is resolved.
* Spanish translation updated thanks to Gerbek.

version 0.2.3 :

* Hotfix.
Expand Down
6 changes: 5 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"CoC7.rangeCombatCard.BaseRange" : "Base range",
"CoC7.rangeCombatCard.LongRange" : "Long range",
"CoC7.rangeCombatCard.ExtremeRange" : "Xtrm range",
"CoC7.rangeCombatCard.OutOfRange": "Out of range",
"CoC7.rangeCombatCard.Cover" : "Under cover",
"CoC7.rangeCombatCard.PointBlankRange" : "Point blank range",
"CoC7.rangeCombatCard.BigTarget": "Big target",
Expand Down Expand Up @@ -156,15 +157,18 @@
"CoC7.WeaponAhdb": "+Half DB",
"CoC7.WeaponAddb": "+DB",
"CoC7.WeaponSlnt": "Silent",
"CoC7.WeaponXplv": "Shotgun",
"CoC7.WeaponXplv": "Explosives",
"CoC7.WeaponBrst": "Burst",
"CoC7.WeaponAuto": "Full-auto",
"CoC7.WeaponSpcl": "Special",
"CoC7.WeaponMont": "Mounted",
"CoC7.WeaponDbrl": "Dual barrel",
"CoC7.WeaponBlst": "Blast",
"CoC7.WeaponStun": "Stun",
"CoC7.Weapon.Property.Melee": "Melee",
"CoC7.Weapon.Property.Thrown": "Thrown",
"CoC7.Weapon.Property.Burn": "Burn",
"CoC7.Weapon.Property.Shotgun": "Shotgun",

"CoC7.ErrorItem": "Couldn't locate item",
"CoC7.ErrorActor": "Couldn't locate actor",
Expand Down
129 changes: 124 additions & 5 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
"CHARAC.EDU": "EDU",
"CHARAC.Education": "Educación",



"CoC7.Name": "Nombre",
"CoC7.Occupation": "Ocupación",
"CoC7.Age": "Edad",
"CoC7.Sex": "Género",
"CoC7.Residence": "Residencia",
"CoC7.Birthplace": "Nacimiento",
"CoC7.Birthplace": "Lugar de Nacimiento",
"CoC7.HitPoints": "Puntos de vida",
"CoC7.HP": "PV",
"CoC7.MagicPoints": "Puntos de magia",
Expand All @@ -42,6 +40,127 @@
"CoC7.Combat": "Combate",
"CoC7.Possessions": "Posesiones",
"CoC7.Background": "Trasfondo",
"CoC7.Notes": "Notas"
"CoC7.Notes": "Notas",

"CoC7.RegularSuccess": "Éxito normal",
"CoC7.HardSuccess": "Éxito difícil",
"CoC7.ExtremeSuccess": "Éxito extremo",
"CoC7.CriticalSuccess": "Éxito crítico",
"CoC7.Fumble": "Pifia",
"CoC7.Failure": "Fallo",
"CoC7.Malfunction": "{itemName} sufre una avería",

"CoC7.Dice": "Dados",
"CoC7.DiceModifierBonus": "bonificación",
"CoC7.DiceModifierPenalty": "penalización",
"CoC7.BonusDice": "Dados de Bonificación",
"CoC7.UnitsDie" : "1 dado de unidades",
"CoC7.TensDie": "dado de decenas",
"CoC7.TensDice": "dados de decenas",
"CoC7.SuccessRequired": "se requiere un éxito {successRequired}.",
"CoC7.Roll": "Tirar dados",
"CoC7.Pushing": "Forzando : ",
"CoC7.PushSkill": "Forzar tirada",
"CoC7.PushedRoll": "(tirada forzada)",
"CoC7.SpendLuck": "Gasta {luckNeededValue} puntos de Suerte para superar la tirada",
"CoC7.LuckSpent": "{luckAmount} puntos de Suerte gastados para superar la tirada",
"CoC7.LuckError": "{actorName} no tiene suficiente Suerte para superar la tirada",

"CoC7.BonusSelectionWindow": "Ventana de selección de bonificación",
"CoC7.RegularDifficulty": "normal",
"CoC7.HardDifficulty": "difícil",
"CoC7.ExtremeDifficulty": "extremo",
"CoC7.CriticalDifficulty": "crítico",
"CoC7.RollDifficulty": "Dificultad de la Tirada",
"CoC7.RollDifficultyRegular": "Normal",
"CoC7.RollDifficultyHard": "Difícil",
"CoC7.RollDifficultyExtreme": "Extremo",
"CoC7.RollDifficultyCritical": "Crítico",
"CoC7.RollResult.LuckSpendText": "{luckAmount} puntos de Suerte gastados, {successLevel} superado",
"CoC7.RollDice": "Tirar dados !",

"CoC7.CheckResult": "tirada de {name} {value}%) - dificultad {difficulty}",
"CoC7.ItemCheckResult": "{item} - tirada de {skill} ({value}%) - dificultad {difficulty}",
"CoC7.CheckRawValue": "({rawvalue}%) - dificultad {difficulty}",

"CoC7.BonusDamageRoll": "Tirada de Bonificación de Daño",
"CoC7.Type": "Tipo",
"CoC7.FightBack": "Contraatacar",
"CoC7.Dodge": "Esquivar",
"CoC7.Maneuver": "Maniobra",
"CoC7.OutNumbered": "Superado",
"CoC7.combatCard.surpised": "Sorprendido",
"CoC7.combatCard.autoSuccess": "Éxito Automático",
"CoC7.Advantage": "Ventaja",
"CoC7.Disadvantage": "Desventaja",

"CoC7.combatCard.dive4cover": "Ponerse a Cubierto",

"CoC7.DropZone": "DropZone",

"CoC7.SkillValue": "Valor",
"CoC7.SkillBase": "Base",

"CoC7.ItemQuantity": "Cantidad",
"CoC7.ItemWeight": "Peso",
"CoC7.ItemDetails": "Detalles",
"CoC7.ItemDescription": "Descripción",
"CoC7.WeaponRange": "Alcance :",
"CoC7.WeaponDamage": "Daño :",
"CoC7.WeaponRadius": "Radio",
"CoC7.WeaponMalfunction": "Avería :",
"CoC7.WeaponUsesPerRound": "Usos/Turno :",
"CoC7.WeaponMax": "Máx :",
"CoC7.WeaponBulletsInMag": "Cargador :",
"CoC7.WeaponSpecial": "Especial :",
"CoC7.ItemPrice": "Precio :",
"CoC7.Armor": "Armadura",

"CoC7.EraNvct": "Invictus",
"CoC7.EraDrka": "Edad Oscura",
"CoC7.EraDdts": "El Viejo Oeste",
"CoC7.EraGlit": "Luz de Gas",
"CoC7.Era1920": "Años 20",
"CoC7.EraPulp": "Pulp Cthulhu",
"CoC7.EraMdrn": "Época Actual",

"CoC7.SkillNoXpGain": "Sin ganancia de EXP",
"CoC7.SkillSpecial": "Especialización",
"CoC7.SkillRarity": "Infrecuente",
"CoC7.SkillPush": "Forzada",
"CoC7.SkillCombat": "Combate",
"CoC7.SkillFighting": "Combatir",
"CoC7.SkillFirearm": "Armas de fuego",

"CoC7.WeaponRngd": "Alcance",
"CoC7.WeaponTouch": "Toque",
"CoC7.WeaponImpl": "Empalar",
"CoC7.WeaponRare": "Rara",
"CoC7.WeaponAhdb": "+½ BD",
"CoC7.WeaponAddb": "+BD",
"CoC7.WeaponSlnt": "Silenciosa",
"CoC7.WeaponXplv": "Área de Efecto",
"CoC7.WeaponBrst": "Ráfaga",
"CoC7.WeaponAuto": "Fuego automático",
"CoC7.WeaponSpcl": "Especial",
"CoC7.WeaponMont": "Montada",
"CoC7.WeaponDbrl": "Dos cañones",
"CoC7.WeaponBlst": "Explosiva",
"CoC7.WeaponStun": "Aturdimiento",

"CoC7.ErrorItem": "No se pudo localizar el ítem",
"CoC7.ErrorActor": "No se pudo localizar al actor",
"CoC7.ErrorInvalidFormula": "{value} no es una fórmula válida",
"CoC7.ErrorInvalid": "inválido",

"CoC7.newBioSectionName": "Nueva Sección",

"CoC7.dodgeSkillName": "Esquivar",
"CoC7.creditRatingSkillName": "Crédito",
"CoC7.fightingSpecializationName": "Combatir",
"CoC7.firearmSpecializationName": "Armas de fuego",

}
"CoC7.newSkillName": "nueva habilidad",
"CoC7.newItemName": "nuevo ítem",
"CoC7.newWeaponName": "nueva arma"
}
25 changes: 17 additions & 8 deletions module/actors/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ export class CoCActor extends Actor {
{
return super.create(data, options);
}
// data.data= { 'biography' : {
// 'ideology': {
// 'value': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
// }
// }};


return super.create(data, options);
}

Expand Down Expand Up @@ -538,12 +531,28 @@ export class CoCActor extends Actor {
}
return this.id;
}


get actorKey(){
return this.tokenKey;
}

static getActorFromKey(key) {

// Case 1 - a synthetic actor from a Token
if (key.includes('.')) {
const [sceneId, tokenId] = key.split('.');
const scene = game.scenes.get(sceneId);
if (!scene) return null;
const tokenData = scene.getEmbeddedEntity('Token', tokenId);
if (!tokenData) return null;
const token = new Token(tokenData);
return token.actor;
}

// Case 2 - use Actor ID directory
return game.actors.get(key) || null;
}

/**
* Use the formula if available to roll some characteritics.
*/
Expand Down
10 changes: 6 additions & 4 deletions module/actors/sheets/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ export class CoC7ActorSheet extends ActorSheet {
}

weapon.data._properties = [];
for( let [key, value] of Object.entries(weapon.data.properties)){
for( let [key, value] of Object.entries(COC7['weaponProperties']))
{
let property = {};
property.id = key;
property.value = value;
property.name = COC7.weaponProperties[key];
weapon.data._properties.push( property);
property.name = value;
property.value = true == weapon.data.properties[key];
weapon.data._properties.push(property);
}

data.weapons[weapon._id] = weapon;
if( weapon.data.properties.rngd) data.rangeWpn.push( weapon);
else data.meleeWpn.push(weapon);
Expand Down
2 changes: 1 addition & 1 deletion module/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class CoC7Chat{

}

static async renderMessageHook(message, html) {
static async renderMessageHook(message, html, data) {

//Handle showing dropdown selection
html.find('.dropbtn').click(event => event.currentTarget.closest('.dropdown').querySelector('.dropdown-content').classList.toggle('show'));
Expand Down
25 changes: 21 additions & 4 deletions module/chat/meleecombat.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export class CoC7MeleeInitiator{
return this.actor.getWeaponSkills( this.itemId);
}

get targetImg(){
if( this.target.actor.isToken) return this.target.data.img;
return this.target.actor.img;
}

template = 'systems/CoC7/templates/chat/combat/melee-initiator.html';

async createChatCard(){
Expand All @@ -52,11 +57,17 @@ export class CoC7MeleeInitiator{

const user = this.actor.user ? this.actor.user : game.user;

const chatMessage = await ChatMessage.create({
const data = {
user: user._id,
speaker,
content: html
});
};

data.flags = {
img: this.actor.isToken ? this.actor.token.data.img: this.actor.img
};

const chatMessage = await ChatMessage.create(data);

return chatMessage;
}
Expand Down Expand Up @@ -323,11 +334,17 @@ export class CoC7MeleeTarget{

const user = this.actor.user ? this.actor.user : game.user;

const message = await ChatMessage.create({
const data = {
user: user._id,
speaker,
content: html
});
};

data.flags = {
img: this.actor.isToken ? this.actor.token.data.img: this.actor.img
};

const message = await ChatMessage.create(data);

this.messageId = message.id;
return message;
Expand Down
Loading

0 comments on commit 5b11b4c

Please sign in to comment.