Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Antho committed Nov 10, 2021
2 parents b17f9f7 + eee15b0 commit 2bb1b0a
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 18 deletions.
8 changes: 7 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,15 @@
"WITCHER.Damage.totalSP": "Total Stopping Power",
"WITCHER.Damage.afterSPReduct": "Damage after sp reducttion",
"WITCHER.Damage.afterLocationModifier": "Damage after location modifier",
"WITCHER.Damage.afterResistances": "Damage after resistances",
"WITCHER.Damage.afterResistances": "Damage after resistances/vulnerabilities",
"WITCHER.Damage.totalApplied": "Total Damage Applied",
"WITCHER.Damage.NotEnough": "Not enough damage to pierce the armor",
"WITCHER.Damage.isVulnerable": "Vulnerable to the attack",
"WITCHER.Damage.oilDmg": "Add Oil Damages (+5)",
"WITCHER.Damage.silverDmg": "Add Silver Damages",
"WITCHER.Damage.silver": "Silver",
"WITCHER.Damage.oil": "Oil",


"WITCHER.Context.applyDmg": "Apply Damage",
"WITCHER.Context.Defense": "Defense",
Expand Down
92 changes: 81 additions & 11 deletions lang/ptbr.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,21 @@
"WITCHER.Armor.Reliable": "DURA",
"WITCHER.Armor.EncumbranceValue": "VF",
"WITCHER.Armor.Resistances": "Resistências",
"WITCHER.Armor.Res": "Res",
"WITCHER.Armor.Bludgeoning": "Concussiva",
"WITCHER.Armor.Slashing": "Cortante",
"WITCHER.Armor.Percing": "Perfurante",
"WITCHER.Armor.Elemental": "Elemental",
"WITCHER.Armor.Type": "Tipo",

"WITCHER.Armor.Light": "Armadura Leve",
"WITCHER.Armor.Medium": "Armadura Média",
"WITCHER.Armor.Heavy": "Armadura Pesada",
"WITCHER.Armor.Natural": "Armadura Natural",

"WITCHER.Armor.LayerBonus": "Bonus de Camada",


"WITCHER.Armor.LocationHead": "Cabeça",
"WITCHER.Armor.LocationTorso": "Tronco",
"WITCHER.Armor.LocationLeg": "Perna",
Expand Down Expand Up @@ -479,7 +490,7 @@
"WITCHER.Monster.WitcherKnowledge": "Conhecimento de Bruxo: Treino de Bruxo ND: ",

"WITCHER.Monster.SkillTab": "Perícias",
"WITCHER.Monster.InventryTab": "Ataques/Equip",
"WITCHER.Monster.InventryTab": "ATK/Loot",
"WITCHER.Monster.DetailsTab": "Detalhes",
"WITCHER.Monster.SpellsTab": "Feitiços",

Expand Down Expand Up @@ -564,6 +575,7 @@
"WITCHER.Spell.Effect": "Efeitos",
"WITCHER.Spell.AlternateComponents": "Componentes Alternativos",
"WITCHER.SPell.Signs": "Sinais",
"WITCHER.Spell.Element": "Elemento",

"WITCHER.Spell.StaCost": "Custo de EST",
"WITCHER.Spell.Variable": "EST Variável",
Expand Down Expand Up @@ -601,8 +613,10 @@
"WITCHER.Dialog.attackRandomMonster": "Aleatório Monstro",
"WITCHER.Dialog.attackHead": "Cabeça",
"WITCHER.Dialog.attackTorso": "Tronco",
"WITCHER.Dialog.attackArm": "Braço",
"WITCHER.Dialog.attackLeg": "Perna",
"WITCHER.Dialog.attackRArm": "Braço Dir.",
"WITCHER.Dialog.attackLArm": "Braço Esq.",
"WITCHER.Dialog.attackRLeg": "Perna Dir.",
"WITCHER.Dialog.attackLLeg": "Perna Esq",
"WITCHER.Dialog.attackLimb": "Membro",
"WITCHER.Dialog.attackTail": "Cauda e Asas",

Expand All @@ -625,12 +639,12 @@
"WITCHER.Dialog.sizeHuge": "Imenso",

"WITCHER.Dialog.rangeNone": "None",
"WITCHER.Dialog.rangePointBlank": "Queima-roupa",
"WITCHER.Dialog.rangeClose": "Perto",
"WITCHER.Dialog.rangeMedium": "Médio",
"WITCHER.Dialog.rangeLong": "Longo",
"WITCHER.Dialog.rangeExtreme": "Extremo",

"WITCHER.Dialog.rangePointBlank": "Queima-roupa (<2m)",
"WITCHER.Dialog.rangeClose": "Perto (1/4 Range)",
"WITCHER.Dialog.rangeMedium": "Médio (1/2 Range)",
"WITCHER.Dialog.rangeLong": "Longo (Full Range)",
"WITCHER.Dialog.rangeExtreme": "Extremo (2x Range)",
"WITCHER.Dialog.strikeNormal": "Golpe Normal",
"WITCHER.Dialog.strikeFast": "Golpe Rápido",
"WITCHER.Dialog.strikeStrong": "Golpe Forte",
Expand All @@ -639,6 +653,7 @@
"WITCHER.Dialog.attackUse": "Ataque utiliza",
"WITCHER.Dialog.attackExtra": "Ataque extra",
"WITCHER.Dialog.attackLocation": "Local de Acerto",
"WITCHER.Dialog.damageType": "Tipo de Dano",
"WITCHER.Dialog.attackModifierse": "Modificadores de Ataque",
"WITCHER.Dialog.attackSize": "Modificadores de Tamanho",
"WITCHER.Dialog.attackRange": "Modificadores de Distância",
Expand All @@ -652,6 +667,8 @@
"WITCHER.Dialog.chooseAmmunition": " Escolha munição",
"WITCHER.Dialog.NoAmmunation": " Não há munições disponíveis",
"WITCHER.Dialog.Ammunation": "Munição",
"WITCHER.Diagram.Bomb": "Bomba",
"WITCHER.Diagram.Traps": "Armadilha",

"WITCHER.Dialog.ButtonRoll": "Rolar",

Expand All @@ -670,7 +687,60 @@
"WITCHER.Currency.ducat" : "Ducates",
"WITCHER.Currency.lintar" : "Lintar",
"WITCHER.Currency.floren" : "Florim",
"WITCHER.Currency.crown" : "Crown",
"WITCHER.Currency.crown" : "Coroa",
"WITCHER.Currency.oren" : "Oren",
"WITCHER.Currency.falsecoin" : "Falsa"
}

"WITCHER.background.activeEffect" : "Efeitos Ativos",

"WITCHER.Spell.CreateTemplate": "Criar um Modelo",
"WITCHER.Spell.meters": "m",
"WITCHER.Spell.Size" : "Tamanho",
"WITCHER.Spell.Type" : "Tipo",
"WITCHER.Spell.Square": "Quadrado",
"WITCHER.Spell.Circle": "Circulo",
"WITCHER.Spell.Cone": "Cone",
"WITCHER.Spell.Ray": "Raio"

"WITCHER.Settings.displayRollDetails": "Exibir detalhes de rolagem",
"WITCHER.Settings.displayRollDetailsHint": "Exibir detalhes nas rolagens : 1d10+2[atrib]+4[perícia]-3[aparar]",
"WITCHER.Settings.Custom": "Personalizado",
"WITCHER.Settings.modifiers": "Mods"

"WITCHER.Resources.modifiers": "Modificadores de Recurso",
"WITCHER.Weapon.onlyDmg": "Rolar só dano"
"WITCHER.Weapon.useAmmo": "Usar Munição",

"WITCHER.Spell.Damage": "Causa Dano",
"WITCHER.Damage.RemoveSP": "Remover PP antes de aplicar Localização.",
"WITCHER.Effect.Rolled": "Rolado"

"WITCHER.Settings.specialFont": "Usar a fonte especial do Witcher",

"WITCHER.SKill.profession": "Prof",
"WITCHER.SKill.pickup": "Pick",
"WITCHER.SKill.learn": "Learn"

"WITCHER.Items.transferTitle": "Transferencia de itens",
"WITCHER.Items.transferMany": "Quantos transferir"


"WITCHER.Damage.damageType": "Qual tipo de dano",
"WITCHER.Damage.ChangeLocation": "Mudar a Localização",
"WITCHER.Damage.resistSilver": "Aplicar resistência à não-prata",
"WITCHER.Damage.resistMeteorite": "Aplicar resistência à não-meteorito",

"WITCHER.Damage.initial": "Dano Bruto",
"WITCHER.Damage.totalSP": "Poder de Parada",
"WITCHER.Damage.afterSPReduct": "Dano pós redução de PP",
"WITCHER.Damage.afterLocationModifier": "Dano pós localização",
"WITCHER.Damage.afterResistances": "Dano após resistência",
"WITCHER.Damage.totalApplied": "Dano Final",
"WITCHER.Damage.NotEnough": "Dano não é suficiente",

"WITCHER.Context.applyDmg": "Aplicar Dano",
"WITCHER.Context.Defense": "Defender",
"WITCHER.Context.SelectActor": "Ao menos 1 ator deve estar selecionado.",

"WITCHER.Armor.tooMuch": "Muitas armaduras do mesmo tipo equipadas"
}
2 changes: 1 addition & 1 deletion module/sheets/WitcherActorSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ export default class WitcherActorSheet extends ActorSheet {
<div class="flex">
<div>
<div><input id="R" type="checkbox" unchecked/> ${game.i18n.localize("WITCHER.Heal.resting")}</div>
<div> <input id="SF" type="checkbox" unchecked/> ${game.i18n.localize("WITCHER.Heal.sterilized")}</div>
<div><input id="SF" type="checkbox" unchecked/> ${game.i18n.localize("WITCHER.Heal.sterilized")}</div>
</div>
<div>
<div><input id="HH" type="checkbox" unchecked/> ${game.i18n.localize("WITCHER.Heal.healinghand")}</div>
Expand Down
42 changes: 37 additions & 5 deletions scripts/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,37 @@ async function ApplyDamage(actor, dmgType, location, totalDamage){
<option value="L. leg"> ${game.i18n.localize("WITCHER.Dialog.attackLLeg")} </option>
<option value="R. Leg"> ${game.i18n.localize("WITCHER.Dialog.attackRLeg")} </option>
<option value="Tail/wing"> ${game.i18n.localize("WITCHER.Dialog.attackTail")} </option>
`;
const silverOptions = `
<option></option>
<option value="1d6">1d6</option>
<option value="2d6">2d6</option>
<option value="3d6">3d6</option>
<option value="4d6">4d6</option>
<option value="5d6">5d6</option>
`;

let content = `<label>${game.i18n.localize("WITCHER.Damage.damageType")}: <select name="damageType">${damageTypeOption}</select></label> <br />
<label>${game.i18n.localize("WITCHER.Damage.ChangeLocation")}: <select name="changeLocation">${locationOptions}</select></label> <br />`

if (actor.type == "monster"){
content += `<label>${game.i18n.localize("WITCHER.Damage.resistSilver")}: <input type="checkbox" name="resistNonSilver"></label><br />
<label>${game.i18n.localize("WITCHER.Damage.resistMeteorite")}: <input type="checkbox" name="resistNonMeteorite"></label>`
<label>${game.i18n.localize("WITCHER.Damage.resistMeteorite")}: <input type="checkbox" name="resistNonMeteorite"></label><br />`
}
content += `<label>${game.i18n.localize("WITCHER.Damage.isVulnerable")}: <input type="checkbox" name="vulnerable"></label><br />
<label>${game.i18n.localize("WITCHER.Damage.oilDmg")}: <input type="checkbox" name="oilDmg"></label><br />
<label>${game.i18n.localize("WITCHER.Damage.silverDmg")}: <select name="silverDmg">${silverOptions}</select></label><br />`

let cancel = true
let damageType = 0
let resistSilver = false;
let resistMeteorite = false;
let newLocation = false;
let isVulnerable = false;
let addOilDmg = false;
let silverDmg;

let infoTotalDmg = totalDamage

let dialogData = {
buttons : [
Expand All @@ -50,16 +66,31 @@ async function ApplyDamage(actor, dmgType, location, totalDamage){
newLocation = html.find("[name=changeLocation]")[0].value;
resistSilver = html.find("[name=resistNonSilver]").prop("checked");
resistMeteorite = html.find("[name=resistNonMeteorite]").prop("checked");
isVulnerable = html.find("[name=vulnerable]").prop("checked");
addOilDmg = html.find("[name=oilDmg]").prop("checked");
silverDmg = html.find("[name=silverDmg]")[0].value;
cancel = false
} ]],
title : game.i18n.localize("WITCHER.Items.transferTitle"),
title : game.i18n.localize("WITCHER.Context.applyDmg"),
content : content
}
await buttonDialog(dialogData)

if (silverDmg){
let silverRoll = new Roll(silverDmg).roll()
totalDamage = Number(totalDamage) + silverRoll.total
infoTotalDmg += `+${silverRoll.total}[${game.i18n.localize("WITCHER.Damage.silver")}]`
}

if (newLocation != "Empty"){
location = newLocation
}
if (addOilDmg){
totalDamage = Number(totalDamage) + 5
infoTotalDmg += `+5[${game.i18n.localize("WITCHER.Damage.oil")}]`
}

infoTotalDmg = totalDamage +": " +infoTotalDmg;

let armorSet = {};
let totalSP = 0
Expand All @@ -72,7 +103,6 @@ async function ApplyDamage(actor, dmgType, location, totalDamage){
values = getArmorSp(armorSet["lightArmor"]?.data.data.headStopping, armorSet["mediumArmor"]?.data.data.headStopping, armorSet["heavyArmor"]?.data.data.headStopping)
displaySP = values[0]
totalSP = values[1]
console.log(values)
break;
case "Torso":
armorSet = getArmors(torsoAmors)
Expand Down Expand Up @@ -141,14 +171,14 @@ async function ApplyDamage(actor, dmgType, location, totalDamage){
return
}

let infoTotalDmg = totalDamage
totalDamage -= totalSP < 0 ? 0: totalSP;

let infoAfterSPReduction = totalDamage < 0 ? 0: totalDamage

if (cancel) {
return
}

if (totalDamage <=0){
let messageContent = `${game.i18n.localize("WITCHER.Damage.initial")}: ${infoTotalDmg} <br />
${game.i18n.localize("WITCHER.Damage.totalSP")}: ${displaySP}<br />
Expand Down Expand Up @@ -193,7 +223,9 @@ async function ApplyDamage(actor, dmgType, location, totalDamage){
if (resistSilver || resistMeteorite) {
totalDamage *= 0.5
}

if (isVulnerable) {
totalDamage *= 2
}
let infoAfterResistance = totalDamage

switch(location){
Expand Down

0 comments on commit 2bb1b0a

Please sign in to comment.