diff --git a/lang/en.json b/lang/en.json index dab5661..0b08f89 100644 --- a/lang/en.json +++ b/lang/en.json @@ -70,12 +70,18 @@ "WH.ui.parrybonustotal": "Parry bonus total", "WH.ui.drbonustotal": "DR bonus total", "WH.ui.counterspell": "Counter spell", - "WH.ui.createitem": "Create item", + "WH.ui.createitem": "Bonus to percentage throws", "WH.ui.classSkills": "Class Skills", - "WH.ui.skills": "Skills", + "WH.ui.skills": "Skills based on level", "WH.ui.isclassskill": "Class skill ?", "WH.ui.unlimited": "Unlimited use ?", "WH.ui.currentuse": "Current use", "WH.ui.maxuse": "Max use", - "WH.ui.languages": "Languages" + "WH.ui.languages": "Languagess", + "WH.ui.languagesbonus": "Bonus Languages (mind/2)", + "WH.ui.competency": "Competency", + "WH.ui.conditions": "Conditions", + "WH.ui.effect": "Effect", + + "WH.chat.save": "Save" } \ No newline at end of file diff --git a/modules/warhero-actor-sheet.js b/modules/warhero-actor-sheet.js index 585867f..2156a94 100644 --- a/modules/warhero-actor-sheet.js +++ b/modules/warhero-actor-sheet.js @@ -46,12 +46,14 @@ export class WarheroActorSheet extends ActorSheet { classSkills: this.actor.getClassSkills( ), languages: this.actor.getLanguages( ), weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ), + conditions: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getConditions()) ), armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())), shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())), powers: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getPowers())), equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ), slotEquipments: this.actor.buildEquipmentsSlot(), subActors: duplicate(this.actor.getSubActors()), + competency: this.actor.getCompetency(), race: duplicate(race), class: duplicate(this.actor.getClass()), moneys: duplicate(this.actor.getMoneys()), diff --git a/modules/warhero-actor.js b/modules/warhero-actor.js index e7d1915..0ed93fd 100644 --- a/modules/warhero-actor.js +++ b/modules/warhero-actor.js @@ -203,6 +203,12 @@ export class WarheroActor extends Actor { return comp; } /* -------------------------------------------- */ + getConditions() { + let comp = duplicate(this.items.filter(item => item.type == 'condition') || []); + WarheroUtility.sortArrayObjectsByName(comp) + return comp; + } + /* -------------------------------------------- */ getItemById(id) { let item = this.items.find(item => item.id == id); if (item) { @@ -365,6 +371,28 @@ export class WarheroActor extends Actor { this.update({ 'system.secondary.hp': hp }) return Number(dmgRoll.total) } + /* -------------------------------------------- */ + updateCompetency(competency, obj) { + for(let key in obj) { + if (obj[key]) { + competency[key] = true + } + } + } + getCompetency() { + let myRace = this.getRace() + let myClass = this.getClass() + let competency = { weapons: {}, armors: {}, shields: {}} + if ( myRace.system && myClass.system) { + this.updateCompetency(competency.weapons, myRace.system.weapons) + this.updateCompetency(competency.armors, myRace.system.armors) + this.updateCompetency(competency.shields, myRace.system.shields) + this.updateCompetency(competency.weapons, myClass.system.weapons) + this.updateCompetency(competency.armors, myClass.system.armors) + this.updateCompetency(competency.shields, myClass.system.shields) + } + return competency + } /* -------------------------------------------- */ getAbility(abilKey) { @@ -549,7 +577,7 @@ export class WarheroActor extends Actor { /* -------------------------------------------- */ setLevel() { let xp = this.system.secondary.xp.value - this.system.secondary.xp.level = Math.floor(xp/10) + this.system.secondary.xp.level = 1 + Math.floor(xp/10) } /* -------------------------------------------- */ computeDRTotal() { diff --git a/modules/warhero-utility.js b/modules/warhero-utility.js index eac2f85..b1df65f 100644 --- a/modules/warhero-utility.js +++ b/modules/warhero-utility.js @@ -519,12 +519,18 @@ export class WarheroUtility { await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) } rollData.roll = myRoll + rollData.diceFormula = diceFormula + rollData.diceResult = myRoll.terms[0].results[0].result rollData.isSuccess = false - if (myRoll.total >= 12 || myRoll.terms[0].results[0].result == 12) { + if (myRoll.total >= 12 || rollData.diceResult == 12) { rollData.isSuccess = true + if (rollData.diceResult == 12) { + rollData.isCriticalSuccess = true + } } - if (myRoll.terms[0].results[0].result == 1) { + if (rollData.diceResult == 1) { rollData.isSuccess = false + rollData.isCriticalFailure = true } let msg = await this.createChatWithRollMode(rollData.alias, { content: await renderTemplate(`systems/fvtt-warhero/templates/chat-parry-result.html`, rollData) @@ -554,6 +560,8 @@ export class WarheroUtility { let myRoll = new Roll(rollData.weapon.damageFormula + "+" + rollData.bonusMalus).roll({ async: false }) await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) rollData.roll = myRoll + rollData.diceFormula = myRoll.formula + rollData.diceResult = myRoll.terms[0].results[0].result let msg = await this.createChatWithRollMode(rollData.alias, { content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData) @@ -571,7 +579,6 @@ export class WarheroUtility { diceFormula += "+" + rollData.mWeaponMalus } diceFormula += "+" + rollData.bonusMalus - rollData.diceFormula = diceFormula // Performs roll console.log("Roll formula", diceFormula) @@ -581,6 +588,14 @@ export class WarheroUtility { await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) } rollData.roll = myRoll + rollData.diceFormula = diceFormula + rollData.diceResult = myRoll.terms[0].results[0].result + if (rollData.diceResult == 20) { + rollData.isCriticalSuccess = true + } + if (rollData.diceResult == 1) { + rollData.isCriticalFailure = true + } let msg = await this.createChatWithRollMode(rollData.alias, { content: await renderTemplate(`systems/fvtt-warhero/templates/chat-generic-result.html`, rollData) diff --git a/styles/simple.css b/styles/simple.css index 57106fe..d357ec6 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1494,4 +1494,10 @@ } form .notes { color: rgba(214, 230, 230, 0.95); + } + .crit-success { + color: darkgreen; + } + .crit-failure { + color: darkred; } \ No newline at end of file diff --git a/system.json b/system.json index 4266b1d..9df51e2 100644 --- a/system.json +++ b/system.json @@ -100,7 +100,7 @@ "styles": [ "styles/simple.css" ], - "version": "10.0.18", + "version": "10.0.19", "compatibility": { "minimum": "10", "verified": "10", @@ -108,7 +108,7 @@ }, "title": "Warhero RPG", "manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.18.zip", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.19.zip", "url": "https://www.uberwald.me/gitea/public/fvtt-warhero", "background": "images/ui/warhero_welcome_page.webp", "id": "fvtt-warhero" diff --git a/template.json b/template.json index e884dc1..0ed5a8f 100644 --- a/template.json +++ b/template.json @@ -56,6 +56,7 @@ "abbrev": "hp", "style": "edit", "hasmax": true, + "isheader": true, "max": 1, "value": 1 }, @@ -98,6 +99,7 @@ "abbrev": "pm", "style": "edit", "hasmax": true, + "isheader": true, "max": 1, "value": 1 }, @@ -187,7 +189,7 @@ "value": 0 }, "nblanguage": { - "label": "WH.ui.languages", + "label": "WH.ui.languagesbonus", "abbrev": "nblanguage", "style": "edit", "disabled": true, @@ -208,14 +210,15 @@ } }, "Item": { - "types": [ "equipment", "race", "weapon", "armor", "shield", "money" , "skill", "power", "language", "condition", "class"], + "types": [ "equipment", "race", "weapon", "armor", "shield", "skill", "power", "language", "condition", "class"], "templates": { "commonclassrace": { "weapons": { "short": false, "long": false, "twohanded": false, - "shotgun": false, + "shooting": false, + "polearm": false, "throwing": false }, "armors": { @@ -231,6 +234,7 @@ } }, "condition": { + "shortdescription": "", "description": "" }, "class": { @@ -247,6 +251,7 @@ "templates": ["commonclassrace"] }, "language": { + "shortdescription": "", "description": "" }, "skill": { @@ -303,11 +308,6 @@ "level4_2": "", "description": "" }, - "money" : { - "value": 0, - "quantity": 0, - "description": "" - }, "spell":{ "lore": "", "circle": 1, diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 68864ea..bc783be 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -23,18 +23,36 @@ +