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 Oct 5, 2022
2 parents e2c13d9 + 80b31b4 commit a09c3ab
Show file tree
Hide file tree
Showing 56 changed files with 8,778 additions and 8,699 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build
/.idea/
1,239 changes: 573 additions & 666 deletions lang/de.json

Large diffs are not rendered by default.

1,690 changes: 781 additions & 909 deletions lang/en.json

Large diffs are not rendered by default.

1,647 changes: 761 additions & 886 deletions lang/es.json

Large diffs are not rendered by default.

1,242 changes: 574 additions & 668 deletions lang/fr.json

Large diffs are not rendered by default.

1,306 changes: 604 additions & 702 deletions lang/it.json

Large diffs are not rendered by default.

1,637 changes: 757 additions & 880 deletions lang/pl.json

Large diffs are not rendered by default.

1,434 changes: 659 additions & 775 deletions lang/ptbr.json

Large diffs are not rendered by default.

1,409 changes: 650 additions & 759 deletions lang/ru.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions module/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ witcher.substanceTypes = {
fulgur: "WITCHER.Inventory.Fulgur",
}

witcher.Avalability = {
Everywhere: "WITCHER.Item.Avalability.Everywhere",
Common: "WITCHER.Item.Avalability.Common",
Poor: "WITCHER.Item.Avalability.Poor",
Rare: "WITCHER.Item.Avalability.Rare",
witcher.Availability = {
Everywhere: "WITCHER.Item.AvailabilityEverywhere",
Common: "WITCHER.Item.AvailabilityCommon",
Poor: "WITCHER.Item.AvailabilityPoor",
Rare: "WITCHER.Item.AvailabilityRare",
}

witcher.Concealment = {
T: "Witcher.Item.Tiny",
S: "Witcher.Item.Small",
L: "Witcher.Item.Large",
NA: "Witcher.Item.CantHide",
T: "WITCHER.Item.Tiny",
S: "WITCHER.Item.Small",
L: "WITCHER.Item.Large",
NA: "WITCHER.Item.CantHide",
}

witcher.MonsterTypes = {
Expand Down
2 changes: 1 addition & 1 deletion module/sheets/MonsterSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async function exportLoot(actor) {
let newLoot = await Actor.create(actor);
await newLoot.update({
"folder": null,
"name" : newLoot.name + "--loot",
"name" : newLoot.name + "--" + `${game.i18n.localize("WITCHER.Loot.Name")}`,
"type" : "loot"
});

Expand Down
122 changes: 20 additions & 102 deletions module/sheets/WitcherActorSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2096,65 +2096,6 @@ export default class WitcherActorSheet extends ActorSheet {
speaker: {alias: this.actor.name},
flavor: `<h1> ${game.i18n.localize("WITCHER.Dialog.attack")}: ${item.name}</h1>`,
}

const locationOptions = `
<option value="randomHuman"> ${game.i18n.localize("WITCHER.Dialog.attackRandomHuman")} </option>
<option value="randomMonster"> ${game.i18n.localize("WITCHER.Dialog.attackRandomMonster")} </option>
<option value="head"> ${game.i18n.localize("WITCHER.Dialog.attackHead")} </option>
<option value="torso"> ${game.i18n.localize("WITCHER.Dialog.attackTorso")} </option>
<option value="L. Arm"> ${game.i18n.localize("WITCHER.Dialog.attackLArm")} </option>
<option value="R. Arm"> ${game.i18n.localize("WITCHER.Dialog.attackRArm")} </option>
<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"> ${game.i18n.localize("WITCHER.Dialog.attackTail")} </option>
`;

const AttackModifierOptions = `
<div id="attackModifiers" class="flex">
<label><input type="checkbox" name="outsideLOS"> ${game.i18n.localize("WITCHER.Dialog.attackOutsideLOS")}</label> <br />
<label><input type="checkbox" name="isFastDraw">${game.i18n.localize("WITCHER.Dialog.attackisFastDraw")}</label> <br />
<label><input type="checkbox" name="isProne">${game.i18n.localize("WITCHER.Dialog.attackisProne")}</label> <br />
<label><input type="checkbox" name="isPinned"> ${game.i18n.localize("WITCHER.Dialog.attackisPinned")}</label> <br />
<label><input type="checkbox" name="isActivelyDodging"> ${game.i18n.localize("WITCHER.Dialog.attackisActivelyDodging")}</label> <br />
<label><input type="checkbox" name="isMoving"> ${game.i18n.localize("WITCHER.Dialog.attackisMoving")}</label> <br />
<label><input type="checkbox" name="targetOutsideLOS"> ${game.i18n.localize("WITCHER.Dialog.attacktargetOutsideLOS")}</label> <br />
<label><input type="checkbox" name="isAmbush"> ${game.i18n.localize("WITCHER.Dialog.attackisAmbush")}</label> <br />
<label><input type="checkbox" name="isRicochet"> ${game.i18n.localize("WITCHER.Dialog.attackisRicochet")}</label> <br />
<label><input type="checkbox" name="isBlinded"> ${game.i18n.localize("WITCHER.Dialog.attackisBlinded")}</label> <br />
<label><input type="checkbox" name="isSilhouetted"> ${game.i18n.localize("WITCHER.Dialog.attackisSilhouetted")}</label> <br />
<label><input type="checkbox" name="isAiming"> ${game.i18n.localize("WITCHER.Dialog.attackisAiming")}: </label> <input type="number" class="small" name="customAim" value=0> <br />
</div>
`;
const rangeOptions = `
<option value="none"> ${game.i18n.localize("WITCHER.Dialog.rangeNone")} </option>
<option value="pointBlank"> ${game.i18n.localize("WITCHER.Dialog.rangePointBlank")} </option>
<option value="close"> ${game.i18n.localize("WITCHER.Dialog.rangeClose")}</option>
<option value="medium"> ${game.i18n.localize("WITCHER.Dialog.rangeMedium")} </option>
<option value="long"> ${game.i18n.localize("WITCHER.Dialog.rangeLong")} </option>
<option value="extreme"> ${game.i18n.localize("WITCHER.Dialog.rangeExtreme")} </option>
`;
const StrikeOptions = `
<option value="normal"> ${game.i18n.localize("WITCHER.Dialog.strikeNormal")} </option>
<option value="fast"> ${game.i18n.localize("WITCHER.Dialog.strikeFast")} </option>
<option value="strong"> ${game.i18n.localize("WITCHER.Dialog.strikeStrong")} </option>
<option value="joint"> ${game.i18n.localize("WITCHER.Dialog.strikeJoint")} </option>
`;
let DamageOptions = '';
if (item.system.type.slashing){
DamageOptions += `<option value="slashing"> ${game.i18n.localize("WITCHER.Armor.Slashing")} </option>`
}
if (item.system.type.piercing){
DamageOptions += `<option value="piercing"> ${game.i18n.localize("WITCHER.Armor.Piercing")} </option>`
}
if (item.system.type.bludgeoning){
DamageOptions += `<option value="bludgeoning"> ${game.i18n.localize("WITCHER.Armor.Bludgeoning")} </option>`
}
if (item.system.type.elemental){
DamageOptions += `<option value="elemental"> ${game.i18n.localize("WITCHER.Armor.Elemental")} </option>`;
}
if (!item.system.type.slashing && !item.system.type.piercing && !item.system.type.bludgeoning && !item.system.type.elemental) {
DamageOptions += `<option value="unavailable">${game.i18n.localize("WITCHER.context.unavailable")}</option>`;
}

let attackSkill = "";

Expand All @@ -2172,7 +2113,7 @@ export default class WitcherActorSheet extends ActorSheet {
attackSkill = game.i18n.localize("WITCHER.SkRefStaff");
break;
case "Swordsmanship":
attackSkill = game.i18n.localize("WITCHER.SkRefSwordmanship");
attackSkill = game.i18n.localize("WITCHER.SkRefSwordsmanship");
break;
case "Archery":
attackSkill = game.i18n.localize("WITCHER.SkDexArchery");
Expand All @@ -2185,52 +2126,30 @@ export default class WitcherActorSheet extends ActorSheet {
break;
}

let content = `<h2>${item.name} ${game.i18n.localize("WITCHER.Dialog.attackUse")}: ${attackSkill}</h2>
<div class="flex">
<label>${game.i18n.localize("WITCHER.Dialog.attackExtra")}: <input type="checkbox" name="isExtraAttack"></label> <br />
</div>
<script>
function myFunction() {
var x = document.getElementById("attackModifiers");
x.style.display = x.style.display === "none" ? "block" : "none";
}
</script>
<label>${game.i18n.localize("WITCHER.Dialog.attackLocation")}: <select name="location">${locationOptions}</select></label> <br />`
if (item.system.range) {
content += `<label>${game.i18n.localize("WITCHER.Dialog.attackRange")}: <select name="range">${rangeOptions}</select></label> ${item.system.range}<br />`
}

content += `<label>${game.i18n.localize("WITCHER.Dialog.attackStrike")}: <select name="strike">${StrikeOptions}</select></label> <br />
<label>${game.i18n.localize("WITCHER.Dialog.damageType")}: <select name="damageType">${DamageOptions}</select></label> <br />
<label>${game.i18n.localize("WITCHER.Dialog.attackCustom")}: <input type="number" class="small" name="customAtt" value=0></label> <br />
<label>${game.i18n.localize("WITCHER.Dialog.attackModifierse")}: <a onclick="myFunction()"><i class="fas fa-chevron-right"></i></a></label> <br />${AttackModifierOptions}<br />
<h2>${item.name} ${game.i18n.localize("WITCHER.Dialog.attackDamage")}: ${displayDmgFormula}</h2>
<label>${game.i18n.localize("WITCHER.Dialog.attackCustomDmg")}: <input type="number" class="small" name="customDmg" value=0></label> <br />`;

if (this.actor.type =="character" && isMeleeAttack){
content += `<label>${game.i18n.localize("WITCHER.Dialog.attackMeleeBonus")}: ${this.actor.system.attackStats.meleeBonus} </label><br />`
}

let ammunitions = ``
let noAmmo = 0
let ammunitionOption = ``
if (item.system.usingAmmo){
let ammunitions = this.actor.items.filter(function(item) {return item.type=="weapon" && item.system.isAmmo});
ammunitions = this.actor.items.filter(function(item) {return item.type=="weapon" && item.system.isAmmo});
let quantity = ammunitions.sum("quantity")
content += `<h2>${game.i18n.localize("WITCHER.Dialog.chooseAmmunition")}</h2> `
if (quantity <= 0) {
content += `<div class="error-display">${game.i18n.localize("WITCHER.Dialog.NoAmmunation")}</h2>`
noAmmo = 1;
}
else {
let ammunationOption = ``
ammunitions.forEach(element => {
ammunationOption += `<option value="${element._id}"> ${element.name}(${element.system.quantity}) </option>`;
else {
ammunitions.forEach(element => {
ammunitionOption += `<option value="${element._id}"> ${element.name}(${element.system.quantity}) </option>`;
});
content += ` <label>${game.i18n.localize("WITCHER.Dialog.Ammunation")}: <select name="ammunation">${ammunationOption}</select></label> <br /><br />`
}
}


let Mymelebonus = this.actor.system.attackStats.meleeBonus
let data = {item, attackSkill, displayDmgFormula, isMeleeAttack, noAmmo, ammunitionOption, ammunitions, Mymelebonus}
const myDialogOptions ={width: 500}
const dialogTemplate = await renderTemplate("systems/TheWitcherTRPG/templates/sheets/weapon-attack.html", data)

new Dialog({
title: `${game.i18n.localize("WITCHER.Dialog.attackWith")}: ${item.name}`,
content,
content: dialogTemplate,
buttons: {
Roll: {
label: `${game.i18n.localize("WITCHER.Dialog.ButtonRoll")}`,
Expand All @@ -2239,8 +2158,8 @@ export default class WitcherActorSheet extends ActorSheet {

let location = html.find("[name=location]")[0].value;
let ammunition = undefined
if (html.find("[name=ammunation]")[0]) {
ammunition = html.find("[name=ammunation]")[0].value;
if (html.find("[name=ammunition]")[0]) {
ammunition = html.find("[name=ammunition]")[0].value;
}

let targetOutsideLOS = html.find("[name=targetOutsideLOS]").prop("checked");
Expand All @@ -2254,7 +2173,6 @@ export default class WitcherActorSheet extends ActorSheet {
let isRicochet = html.find("[name=isRicochet]").prop("checked");
let isBlinded = html.find("[name=isBlinded]").prop("checked");
let isSilhouetted = html.find("[name=isSilhouetted]").prop("checked");
let isAiming = html.find("[name=isAiming]").prop("checked");
let customAim = html.find("[name=customAim]")[0].value;

let range = item.system.range ? html.find("[name=range]")[0].value: null;
Expand Down Expand Up @@ -2300,7 +2218,7 @@ export default class WitcherActorSheet extends ActorSheet {
if (isRicochet) { attFormula += "-5"; }
if (isBlinded) { attFormula += "-3"; }
if (isSilhouetted) { attFormula += "+2"; }
if (isAiming) { attFormula += `+${customAim}`}
if (customAim > 0) { attFormula += `+${customAim}`}

let modifiers;

Expand All @@ -2327,7 +2245,7 @@ export default class WitcherActorSheet extends ActorSheet {
break;
case "Swordsmanship":
attFormula += !displayRollDetails ? `+${this.actor.system.stats.ref.current}+${this.actor.system.skills.ref.swordsmanship.value}`:
`+${this.actor.system.stats.ref.current}[${game.i18n.localize("WITCHER.Actor.Stat.Ref")}]+${this.actor.system.skills.ref.swordsmanship.value}[${game.i18n.localize("WITCHER.SkRefSwordmanship")}]`;
`+${this.actor.system.stats.ref.current}[${game.i18n.localize("WITCHER.Actor.Stat.Ref")}]+${this.actor.system.skills.ref.swordsmanship.value}[${game.i18n.localize("WITCHER.SkRefSwordsmanship")}]`;
modifiers = this.actor.system.skills.ref.swordsmanship.modifiers;
break;
case "Archery":
Expand Down Expand Up @@ -2517,7 +2435,7 @@ export default class WitcherActorSheet extends ActorSheet {
}
}
}
}).render(true)
}, myDialogOptions).render(true)

}

Expand Down
2 changes: 1 addition & 1 deletion module/witcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function getRefSkillMod(actor, skillNum){
case 6:
return [game.i18n.localize("WITCHER.SkRefStaff"), actor.system.skills.ref.staffspear.value, actor.system.skills.ref.staffspear.modifiers]
case 7:
return [game.i18n.localize("WITCHER.SkRefSwordmanship"), actor.system.skills.ref.swordsmanship.value, actor.system.skills.ref.swordsmanship.modifiers]
return [game.i18n.localize("WITCHER.SkRefSwordsmanship"), actor.system.skills.ref.swordsmanship.value, actor.system.skills.ref.swordsmanship.modifiers]
}
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/TheWitcherTRPG.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ async function createBoilerplateMacro(data, slot) {
return ui.notifications.warn("You can only create macro buttons with the original character");
}
const command =
`let actor = game.actors.get('${foundActor.id}');
`actor = game.actors.get('${foundActor.id}');
actor.rollItem("${weapon._id}")`;
let macro = game.macros.find(m => (m.name === weapon.name) && (m.command === command));
if (!macro) {
Expand Down Expand Up @@ -213,7 +213,7 @@ actor.rollItem("${weapon._id}")`;
return ui.notifications.warn("You can only create macro buttons with the original character");
}
const command =
`let actor = game.actors.get('${foundActor.id}');
`actor = game.actors.get('${foundActor.id}');
actor.rollSpell("${spell._id}")`;
let macro = game.macros.find(m => (m.name === spell.name) && (m.command === command));
if (!macro) {
Expand Down
6 changes: 3 additions & 3 deletions scripts/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ function ExecuteDefense(actor){
case "Swordsmanship":
skill = actor.system.skills.ref.swordsmanship.value;
skillName = actor.system.skills.ref.swordsmanship.label;
displayFormula = `1d10 + ${game.i18n.localize("WITCHER.Actor.Stat.Ref")} + ${game.i18n.localize("WITCHER.SkRefSwordmanship")}`;
displayFormula = `1d10 + ${game.i18n.localize("WITCHER.Actor.Stat.Ref")} + ${game.i18n.localize("WITCHER.SkRefSwordsmanship")}`;
modifiers = actor.system.skills.ref.swordsmanship.modifiers
break;
}
Expand Down Expand Up @@ -662,7 +662,7 @@ function ExecuteDefense(actor){
case "Swordsmanship":
skill = actor.system.skills.ref.swordsmanship.value;
skillName = actor.system.skills.ref.swordsmanship.label;
displayFormula = `1d10 + ${game.i18n.localize("WITCHER.Actor.Stat.Ref")} + ${game.i18n.localize("WITCHER.SkRefSwordmanship")} - 3`;
displayFormula = `1d10 + ${game.i18n.localize("WITCHER.Actor.Stat.Ref")} + ${game.i18n.localize("WITCHER.SkRefSwordsmanship")} - 3`;
modifiers = actor.system.skills.ref.swordsmanship.modifiers
break;
}
Expand Down Expand Up @@ -731,7 +731,7 @@ function ExecuteDefense(actor){
case "Swordsmanship":
skill = actor.system.skills.ref.swordsmanship.value;
skillName = actor.system.skills.ref.swordsmanship.label;
displayFormula = `1d10 + ${game.i18n.localize("WITCHER.Actor.Stat.Ref")} + ${game.i18n.localize("WITCHER.SkRefSwordmanship")} - 5`;
displayFormula = `1d10 + ${game.i18n.localize("WITCHER.Actor.Stat.Ref")} + ${game.i18n.localize("WITCHER.SkRefSwordsmanship")} - 5`;
modifiers = actor.system.skills.ref.swordsmanship.modifiers
break;
}
Expand Down
6 changes: 6 additions & 0 deletions styles/monster-sheet.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
.monster-flex {
display: flex;
flex-wrap: wrap;
}

.monster-flex-small{
flex-grow:1;
flex-basis: 100%;
}

.monster-main {
Expand Down
4 changes: 0 additions & 4 deletions styles/tab-inventory.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
flex-direction: column;
}

#attackModifiers {
display: none;
}

.wrapper {
position: relative;
}
Expand Down
19 changes: 19 additions & 0 deletions styles/weapon-roll.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.wepon_roll_sheet input {
text-align: center !important;
margin: 0px 5px;
width: 30px;
float: right;
}

.wepon_roll_sheet td {
height: 35px;
}

.wepon_roll_sheet select {
margin: 0px 5px;
float: right;
}

.wepon_roll_sheet label {
vertical-align: middle;
}
1 change: 1 addition & 0 deletions styles/witcher-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import "./crit-wounds-table.css";
@import "./item-sheets.css";
@import "./substances.css";
@import "./weapon-roll.css";

@font-face {
font-family:'Thewitcher';
Expand Down
8 changes: 5 additions & 3 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"id": "TheWitcherTRPG",
"title": "TheWitcherTRPG - fvtt",
"description": "The Witcher TRPG System.",
"minimumCoreVersion" : "10",
"compatibleCoreVersion" : "10",
"version": 0.92,
"compatibility" : {
"minimum" : "10",
"verified" : "10.284"
},
"version": 0.93,
"authors": {
"name": "TechAntho"
},
Expand Down
Loading

0 comments on commit a09c3ab

Please sign in to comment.