From a5fd2a6102eaa4d5a401d3b25ca91f738513442d Mon Sep 17 00:00:00 2001 From: Daniel Tschiedel Date: Sat, 27 Mar 2021 15:56:52 -0300 Subject: [PATCH 1/9] =?UTF-8?q?aumentando=20o=20tamanho=20das=20caixas=20d?= =?UTF-8?q?e=20pontos=20de=20atributo,=20cria=C3=A7=C3=A3o=20e=20experi?= =?UTF-8?q?=C3=AAncia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OperaRPG/operarpg.css | 4 ++++ OperaRPG/operarpg.html | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/OperaRPG/operarpg.css b/OperaRPG/operarpg.css index 683112d3f8..90a9d7b063 100644 --- a/OperaRPG/operarpg.css +++ b/OperaRPG/operarpg.css @@ -31,6 +31,10 @@ width: 4.2em; } +.sheet-bigger-number-input { + width: 6em !important; +} + .sheet-main-container textarea { box-sizing: border-box; margin: 0px; diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index a0614e8871..503735598c 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -22,8 +22,8 @@ Max Usado - - + @@ -33,8 +33,8 @@ Max Usado - - + @@ -969,7 +969,7 @@
Pontos de Experiência - +
From b94a5433bc9da4142ec2e27fc17dbfcf0c475c22 Mon Sep 17 00:00:00 2001 From: Daniel Tschiedel Date: Sat, 27 Mar 2021 16:06:36 -0300 Subject: [PATCH 2/9] =?UTF-8?q?Incluindo=20a=20regra=20de=20mod=20de=20esq?= =?UTF-8?q?uiva=20=C3=A0=20tamanho=20ampliado=20e=20reduzido?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OperaRPG/operarpg.html | 14 ++++++++++++-- OperaRPG/translation.json | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index 503735598c..b1035f216e 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -364,12 +364,12 @@ Tamanho + title="Comprada a partir do nível 2. Atribuí a expressão “x(nível)” ao atributo Físico e gera nível-1 de penalidade à Esquiva.">Tamanho Ampliado Tamanho + title="Comprada a partir do nível 2. Atribuí a expressão “/(nível)” ao atributo Físico e gera nível-1 de bônus à Esquiva.">Tamanho Reduzido @@ -1575,6 +1575,11 @@ target: 'charphysicalfeatureeffect', value: level => level, operation: OperationEnum.MULT + }, + { + target: 'dodgefeatureeffect', + value: level => (-1)*(level-1), + operation: OperationEnum.SUM } ] }, @@ -1588,6 +1593,11 @@ target: 'charphysicalfeatureeffect', value: level => (-1)*level, operation: OperationEnum.MULT + }, + { + target: 'dodgefeatureeffect', + value: level => (level-1), + operation: OperationEnum.SUM } ] } diff --git a/OperaRPG/translation.json b/OperaRPG/translation.json index c17923d3f3..e8eea27a4b 100644 --- a/OperaRPG/translation.json +++ b/OperaRPG/translation.json @@ -39,7 +39,7 @@ "fast_reflexes-description": "Cada nível atribuí +1 de Esquiva", "fast_reflexes": "Reflexos Rápidos", "increased_senses-description": "Cada nível atribuí +1 de Percepção", - "increased_senses": "Sentidos\n Ampliados", + "increased_senses": "Sentidos Ampliados", "reduced_senses-description": "Cada nível atribuí -1 de Percepção", "reduced_senses": "Sentidos Reduzidos", "increased_mind-description": "Cada nível atribuí +1 de Mente", @@ -53,27 +53,27 @@ "weak_will-description": "Cada nível atribuí -1 de Vontade", "weak_will": "Vontade Fraca", "additional_limbs-description": "Cada dois níveis, atribuí a expressão “x(nível/2+1)” ao atributo Destreza. Adiciona seu (nível/2) ao número de ações físicas ao personagem", - "additional_limbs": "Membros\n Adicionais", - "increased_size-description": "Comprada a partir do nível 2. Atribuí a expressão “x(nível)” ao atributo Físico", - "increased_size": "Tamanho\n Ampliado", - "reduced_size-description": "Comprada a partir do nível 2. Atribuí a expressão “/(nível)” ao atributo Físico", - "reduced_size": "Tamanho\n Reduzido", + "additional_limbs": "Membros Adicionais", + "increased_size-description": "Comprada a partir do nível 2. Atribuí a expressão “x(nível)” ao atributo Físico e gera nível-1 de penalidade à Esquiva.", + "increased_size": "Tamanho Ampliado", + "reduced_size-description": "Comprada a partir do nível 2. Atribuí a expressão “/(nível)” ao atributo Físico e gera nível-1 de bônus à Esquiva.", + "reduced_size": "Tamanho Reduzido", "feature": "Característica", "level": "Nível", "cost": "Custo", "description": "Descrição", "powers": "Poderes", "increased_dexterity-description": "Comprada a partir do nível 2. Atribuí a expressão “x(nível)” ao atributo Destreza. Adiciona seu (nível-1) ao número de ações físicas ao personagem.", - "increased_dexterity": "Ampliação\n de Destreza", + "increased_dexterity": "Ampliação de Destreza", "increased_physical-description": "Comprada a partir do nível 2. Atribuí a expressão “x(nível)” ao atributo Físico", - "increased_physical": "Ampliação de\n Físico", + "increased_physical": "Ampliação de Físico", "increased_intelligence-description": "Comprada a partir do nível 2. Atribuí a expressão “x(nível)” ao atributo Inteligência. Adiciona seu (nível-1) ao número de ações mentais ao personagem.", - "increased_intelligence": "Ampliação\n de Inteligência", + "increased_intelligence": "Ampliação de Inteligência", "reduced_dexterity-description": "Comprada a partir do nível 2. Atribuí a expressão “/(nível)” ao atributo Inteligência", - "reduced_dexterity": "Redução de\n Destreza", + "reduced_dexterity": "Redução de Destreza", "reduced_physical-description": "Comprada a partir do nível 2. Atribuí a expressão “/(nível)” ao atributo Físico", - "reduced_physical": "Redução de\n Físico", - "reduced_intelligence": "Redução de\n Inteligência", + "reduced_physical": "Redução de Físico", + "reduced_intelligence": "Redução de Inteligência", "skills": "Habilidades", "skill": "Habilidade", "attribute": "Atributo", From 00ec49597cc9fb8079c6feea8f1ec265ec86d84f Mon Sep 17 00:00:00 2001 From: Daniel Tschiedel Date: Sat, 27 Mar 2021 17:41:20 -0300 Subject: [PATCH 3/9] implementado o novo calculo de custo de nivel de habilidades --- OperaRPG/operarpg.html | 37 ++++++++----------------------------- OperaRPG/translation.json | 6 +++--- 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index b1035f216e..197c77bb74 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -359,7 +359,7 @@ Membros + title="Cada dois níveis, atribuí a expressão “x(nível/2+1)” ao atributo Destreza. Adiciona seu (nível/2) ao número de ações físicas do personagem">Membros Adicionais @@ -433,7 +433,7 @@ Ampliação + title="Comprada a partir do nível 2. Atribuí a expressão “x(nível)” ao atributo Destreza. Adiciona seu (nível-1) ao número de ações físicas do personagem.">Ampliação de Destreza @@ -445,7 +445,7 @@ Ampliação + title="Comprada a partir do nível 2. Atribuí a expressão “x(nível)” ao atributo Inteligência. Adiciona seu (nível-1) ao número de ações mentais do personagem.">Ampliação de Inteligência @@ -900,13 +900,7 @@ data-i18n-placeholder="fight" placeholder="Briga" /> Destreza - + @@ -936,12 +930,7 @@ - + Date: Sun, 28 Mar 2021 13:33:46 -0300 Subject: [PATCH 4/9] implemeting the skill total cap of 14 --- OperaRPG/operarpg.html | 86 +++++++++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 13 deletions(-) diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index 197c77bb74..120de558ab 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -899,11 +899,11 @@ Destreza - + - +
@@ -921,20 +921,20 @@ value="&{template:main} {{charname=@{character_name}}} {{action=@{skill}}} {{value=[[@{skilltotal}]]}} {{dispute=[[ [[2d6cs>2cf<5]] + @{skilltotal}]]}} {{roll=$[[1]]}}"> - +
@@ -1255,6 +1255,66 @@ }); }); + /*sets a skill total. If the total exceeds 14, sets the maximum 14 */ + function setSkillTotal(attributeField, levelField, totalField) { + + getAttrs([attributeField, levelField], function(values) { + let total = 0; + let target = {}; + + total += parseInt(values[attributeField])||0; + total += parseInt(values[levelField])||0; + + console.log(total); + + target[totalField] = total > 14? 14 : total; + + setAttrs(target); + }); + } + + /* setting the Fight Skill Total */ + on('change:chardexterity change:fightlevel', function(eventInfo) { + setSkillTotal('chardexterity', 'fightlevel', 'fighttotal'); + }); + + /* Since the repeating_skills skillattribute has changed from @{attributeName} to + * simply attributeName, this parse is needed to make the skill total calc worker + * with old sheets */ + function parseAttributeName(attrName) { + let ret = attrName.replace('@{','').replace('}',''); + + return ret; + } + + /* setting skill total */ + on('change:repeating_skills:skillattribute change:repeating_skills:skilllevel ' + + 'change:charphysique '+ + 'change:chardexterity '+ + 'change:charintelligence '+ + 'change:charperception '+ + 'change:charwill '+ + 'change:charmind '+ + 'change:charmagic '+ + 'change:charluck ' + , function(eventInfo) { + + /* recovering all skills IDs */ + getSectionIDs(`repeating_skills`, idArray => { + idArray.forEach(id => { + + /*recovering skill attribute name */ + getAttrs([`repeating_skills_${id}_skillattribute`], values => { + let attrName = parseAttributeName(values[`repeating_skills_${id}_skillattribute`]); + + setSkillTotal(attrName, `repeating_skills_${id}_skilllevel` , `repeating_skills_${id}_skilltotal`) + + }); + }); + + }); + }); + const fightParameters = [ { fightblow: 0, From 107d1a29c9f4c0172a6bb310e587b402565b7ff5 Mon Sep 17 00:00:00 2001 From: Daniel Tschiedel Date: Sun, 28 Mar 2021 13:49:04 -0300 Subject: [PATCH 5/9] fixing contact weapons damage total calculation --- OperaRPG/operarpg.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index 120de558ab..3bc9d8a9f2 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -1172,7 +1172,18 @@ /*Controlling contact weapons damage total*/ on('change:repeating_contactweapons:weapondamage change:physicaldamage', function(eventInfo) { console.log('weapon damage total'); - setRollTotal(['repeating_contactweapons_weapondamage', 'physicaldamage'], 'repeating_contactweapons_weapondamagetotal'); + + /* recovering all weapons IDs */ + getSectionIDs(`repeating_contactweapons`, idArray => { + idArray.forEach(id => { + + setRollTotal([`repeating_contactweapons_${id}_weapondamage`, 'physicaldamage'], `repeating_contactweapons_${id}_weapondamagetotal`); + + }); + + }); + + }); /* calculating physical damage */ @@ -1187,7 +1198,7 @@ factor = Math.floor(eval(parse)); total = Math.floor(factor/8); - + console.log(`physical damage total: ${total}`); setAttrs({ physicaldamage: total }); From 52d30fff872aee665cb6a440829fbbb40cb39a9d Mon Sep 17 00:00:00 2001 From: Daniel Tschiedel Date: Sun, 28 Mar 2021 14:14:36 -0300 Subject: [PATCH 6/9] removing fight bonuses from contact weapons blow and parry --- OperaRPG/operarpg.html | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index 3bc9d8a9f2..e3ce42aefa 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -660,18 +660,18 @@
+ value="@{weaponlevel} + @{weaponblow} + (@{chardexterity} @{weaponeffect})" /> + value="&{template:main} {{charname=@{character_name}}} {{action=@{weaponname} - @{blow}}} {{value=[[@{weaponblowtotal}]]}} {{dispute=[[ [[2d6cs>2cf<5]] + @{weaponblowtotal} ]] }} {{roll=$[[1]]}} {{damage=[[@{weapondamagetotal}]]}} {{bodyroll=[[2d6cs0cf0]]}}">
+ value="@{weaponlevel} + @{weaponparry} + (@{chardexterity} @{weaponeffect})" /> + value="&{template:main} {{charname=@{character_name}}} {{action=@{weaponname} - @{parry}}} {{value=[[@{weaponparrytotal}]]}} {{dispute=[[ [[2d6cs>2cf<5]] + @{weaponparrytotal} ]] }} {{roll=$[[1]]}}">
@@ -721,7 +721,7 @@ value="0" /> + value="@{weaponlevel} + @{weaponblow} + (@{chardexterity} @{weaponeffect})" />
@@ -729,7 +729,7 @@ value="0" /> + value="@{weaponlevel} + @{weaponparry} + (@{chardexterity} @{weaponeffect})" />
@@ -1335,15 +1335,15 @@ }, { fightblow: 1, - fightparry: 0, + fightparry: 1, fightdodgebonus: 0, fightdamage: 'd2-1' }, { - fightblow: 1, - fightparry: 1, + fightblow: 2, + fightparry: 2, fightdodgebonus: 1, - fightdamage: '1' + fightdamage: 'd2-1' }, { fightblow: 2, @@ -1356,6 +1356,18 @@ fightparry: 3, fightdodgebonus: 2, fightdamage: '1' + }, + { + fightblow: 4, + fightparry: 4, + fightdodgebonus: 2, + fightdamage: '1' + }, + { + fightblow: 4, + fightparry: 4, + fightdodgebonus: 2, + fightdamage: '1' } ]; @@ -1366,7 +1378,9 @@ out = {}; let skillCost = getSkillCost(skillLevel); - let fightParams = fightParameters[skillLevel]; + + /* fight levels beyond 6 give no more bonus, so we have to use the level 6 bonus */ + let fightParams = skillLevel>6 ? fightParameters[6]:fightParameters[skillLevel]; out.fightcost = skillCost; out = Object.assign(out, fightParams); From 7852fb0c1666dbabbfaea2d52331ddbf548eec77 Mon Sep 17 00:00:00 2001 From: Daniel Tschiedel Date: Sun, 28 Mar 2021 14:23:32 -0300 Subject: [PATCH 7/9] finished updating fight skill new bonuses --- OperaRPG/operarpg.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index e3ce42aefa..2c1c73883f 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -1336,37 +1336,37 @@ { fightblow: 1, fightparry: 1, - fightdodgebonus: 0, - fightdamage: 'd2-1' - }, - { - fightblow: 2, - fightparry: 2, fightdodgebonus: 1, fightdamage: 'd2-1' }, { fightblow: 2, fightparry: 2, - fightdodgebonus: 1, + fightdodgebonus: 2, + fightdamage: 'd2-1' + }, + { + fightblow: 2, + fightparry: 2, + fightdodgebonus: 2, fightdamage: '1' }, { fightblow: 3, fightparry: 3, - fightdodgebonus: 2, + fightdodgebonus: 3, fightdamage: '1' }, { fightblow: 4, fightparry: 4, - fightdodgebonus: 2, + fightdodgebonus: 4, fightdamage: '1' }, { fightblow: 4, fightparry: 4, - fightdodgebonus: 2, + fightdodgebonus: 4, fightdamage: '1' } ]; From 40b198bf6f0d32f79615c1e977327638ca448cc2 Mon Sep 17 00:00:00 2001 From: Daniel Tschiedel Date: Tue, 30 Mar 2021 22:57:01 -0300 Subject: [PATCH 8/9] finished making the new creation points total cost rules (max -20 and half beyond -10) --- OperaRPG/operarpg.html | 96 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 91 insertions(+), 5 deletions(-) diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index 2c1c73883f..7ffd153075 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -34,8 +34,8 @@ Usado - + @@ -1228,19 +1228,105 @@ repeatingSum("totalpenalty","protection", "protectionpenalty"); }); + /* Declaring a Cost Object to be used on creation points calculation */ + function Cost(negative, positive) { + this.negative = negative; + this.positive = positive; + } + + /* calculates total Cost of a repeating section */ + function calculateCost(section, field, total) { + + getSectionIDs(section, idArray => { + const fields = idArray.map(id => `${section}_${id}_${field}`); + + getAttrs(fields, function(values) { + console.log(`begin calc Cost for ${total} `); + let out = {}; + out[total] = new Cost(0,0); + + for (let key in values) { + let parsedValue = parseInt(values[key])||0; + + if (parsedValue > 0) { + out[total].positive += parsedValue; + } else { + out[total].negative += parsedValue; + } + + } + + console.log(out); + + setAttrs(out); + }); + + }); + } + + function getIntValue(value) { + return parseInt(value)||0; + } + + /* calculating total creation points */ + on('sheet:opened change:fightcost ' + + 'change:powers_total_cost ' + + 'change:skills_total_cost ' + + 'change:features_total_cost' + , function() { + + getAttrs(['fightcost', 'powers_total_cost', 'skills_total_cost', 'features_total_cost'], values =>{ + let totalNegative = 0; + let totalPositive = 0; + console.log('begin calc creation points'); + for (let key in values) { + v = values[key]; + console.log(v); + if (v.positive !== undefined) { + totalPositive += getIntValue(v.positive); + totalNegative += getIntValue(v.negative); + } else { + /*if it doesn't have the positive property, than it is the simple fightcost value */ + totalPositive += getIntValue(v); + } + } + + /* each negative point beyond -10 costs half rounded down. + * Ex: -15 has -5 past -10, so -15 will be (-10) + (-5/2) = -10 -2 = -12. + */ + if (totalNegative < -10) { + + totalNegative = -10 + Math.floor((totalNegative+10)/2); + } + + /* the max negative cost is -20 */ + if (totalNegative < -20) { + totalNegative = -20; + } + + console.log(`total negative = ${totalNegative}`); + console.log(`total positive = ${totalPositive}`); + + setAttrs({ + used_creation_points: totalPositive+totalNegative + }); + }); + }); + + /* calculating total powers cost */ on('sheet:opened change:repeating_powers remove:repeating_powers', function() { - repeatingSum("powers_total_cost","powers", "powercost"); + calculateCost("repeating_powers", "powercost", "powers_total_cost"); }); /* calculating total skills cost */ on('sheet:opened change:repeating_skills remove:repeating_skills', function() { - repeatingSum("skills_total_cost","skills", "skillcost"); + calculateCost("repeating_skills", "skillcost", "skills_total_cost"); }); /* calculating total features cost */ on('sheet:opened change:repeating_features remove:repeating_features', function() { - repeatingSum("features_total_cost","features", "featurecost"); + calculateCost("repeating_features", "featurecost", "features_total_cost"); }); function getSkillCost(skillLevel) { From abe8ceeb9320f8924e658e8fc031bd254ef12355 Mon Sep 17 00:00:00 2001 From: Daniel Tschiedel Date: Wed, 31 Mar 2021 12:04:09 -0300 Subject: [PATCH 9/9] fixing fight default cost and level --- OperaRPG/operarpg.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OperaRPG/operarpg.html b/OperaRPG/operarpg.html index 7ffd153075..9c12248afd 100644 --- a/OperaRPG/operarpg.html +++ b/OperaRPG/operarpg.html @@ -562,7 +562,7 @@ - + @@ -901,7 +901,7 @@ Destreza - +