Skip to content

Commit

Permalink
feat(class calculation): fix the calculation, change the names and wa…
Browse files Browse the repository at this point in the history
…s been added the bonus calc
  • Loading branch information
SouOWendel committed Jan 3, 2024
1 parent 4729d73 commit f38a5b7
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 28 deletions.
6 changes: 3 additions & 3 deletions lang/en.json
Expand Up @@ -104,9 +104,9 @@

"ordemparanormal.className": "Class",
"ordemparanormal.classChoices": {
"combatente": "Fighter",
"especialista": "Specialist",
"ocultista": "Occultist"
"fighter": "Fighter",
"specialist": "Specialist",
"occultist": "Occultist"
},

"ordemparanormal.originName": "Origin",
Expand Down
6 changes: 3 additions & 3 deletions lang/pt-BR.json
Expand Up @@ -104,9 +104,9 @@

"ordemparanormal.className": "Classe",
"ordemparanormal.classChoices": {
"combatente": "Combatente",
"especialista": "Especialista",
"ocultista": "Ocultista"
"fighter": "Combatente",
"specialist": "Especialista",
"occultist": "Ocultista"
},

"ordemparanormal.originName": "Origem",
Expand Down
12 changes: 6 additions & 6 deletions module/helpers/config.mjs
Expand Up @@ -86,31 +86,31 @@ ordemparanormal.dropdownDegree = {
* @type {Object}
*/
ordemparanormal.dropdownClass = {
'Combatente': 'ordemparanormal.classChoices.combatente',
'Especialista': 'ordemparanormal.classChoices.especialista',
'Ocultista': 'ordemparanormal.classChoices.ocultista'
'fighter': 'ordemparanormal.classChoices.fighter',
'specialist': 'ordemparanormal.classChoices.specialist',
'occultist': 'ordemparanormal.classChoices.occultist'
};

/**
* The set of Ability Scores used within the system.
* @type {Object}
*/
ordemparanormal.dropdownTrilha = {
Combatente: [
fighter: [
{name: 'aniquilador', label: 'ordemparanormal.trilhas.aniquilador'},
{name: 'comanDeCamp', label: 'ordemparanormal.trilhas.comandanteDeCampo'},
{name: 'opeEspeciais', label: 'ordemparanormal.trilhas.operacoesEspeciais'},
{name: 'tropaChoque', label: 'ordemparanormal.trilhas.tropaDeChoque'},
{name: 'guerreiro', label: 'ordemparanormal.trilhas.guerreiro'},
],
Especialista: [
specialist: [
{name: 'infiltrador', label: 'ordemparanormal.trilhas.infiltrador'},
{name: 'atiradorElite', label: 'ordemparanormal.trilhas.atiradorDeElite'},
{name: 'medicoCampo', label: 'ordemparanormal.trilhas.medicoDeCampo'},
{name: 'negociador', label: 'ordemparanormal.trilhas.negociador'},
{name: 'tecnico', label: 'ordemparanormal.trilhas.tecnico'},
],
Ocultista: [
occultist: [
{name: 'conduite', label: 'ordemparanormal.trilhas.conduite'},
{name: 'flagelador', label: 'ordemparanormal.trilhas.flagelador'},
{name: 'graduado', label: 'ordemparanormal.trilhas.graduado'},
Expand Down
37 changes: 24 additions & 13 deletions module/sheets/actor-sheet.mjs
Expand Up @@ -112,25 +112,36 @@ export class OrdemActorSheet extends ActorSheet {
context.data.PE.perRound = calcNEX;

// DEFININDO STATUS CONFORME A CLASSE
// TODO: Converter as classes para o inglês
if (context.data.class == 'Combatente') {
context.data.PV.max += (20 + VIG) + ((nexIf) && nexAdjust * (4 + VIG));
context.data.PE.max += (2 + PRE) + ((nexIf) && nexAdjust * (2 + PRE));
context.data.SAN.max += (12) + ((nexIf) && nexAdjust * 3);
} else if (context.data.class == 'Especialista') {
context.data.PV.max += (16 + VIG) + ((nexIf) && nexAdjust * (3 + VIG));
context.data.PE.max += (3 + PRE) + ((nexIf) && nexAdjust * (3 + PRE));
context.data.SAN.max += (16) + ((nexIf) && nexAdjust * 4);
} else if (context.data.class == 'Ocultista') {
context.data.PV.max += (12 + VIG) + ((nexIf) && nexAdjust * (2 + VIG));
context.data.PE.max += (4 + PRE) + ((nexIf) && nexAdjust * (4 + PRE));
context.data.SAN.max += (20) + ((nexIf) && nexAdjust * 5);

// Resolvendo incompatibilidade com classes (será retirado futuramente)
if (context.data.class == 'Combatente') context.data.class == 'fighter';
else if (context.data.class == 'Especialista') context.data.class == 'specialist';
else if (context.data.class == 'Ocultista') context.data.class == 'occultist';

if (context.data.class == 'fighter') {
context.data.PV.max = (20 + VIG) + ((nexIf) && nexAdjust * (4 + VIG));
context.data.PE.max = (2 + PRE) + ((nexIf) && nexAdjust * (2 + PRE));
context.data.SAN.max = (12) + ((nexIf) && nexAdjust * 3);
} else if (context.data.class == 'specialist') {
context.data.PV.max = (16 + VIG) + ((nexIf) && nexAdjust * (3 + VIG));
context.data.PE.max = (3 + PRE) + ((nexIf) && nexAdjust * (3 + PRE));
context.data.SAN.max = (16) + ((nexIf) && nexAdjust * 4);
} else if (context.data.class == 'occultist') {
context.data.PV.max = (12 + VIG) + ((nexIf) && nexAdjust * (2 + VIG));
context.data.PE.max = (4 + PRE) + ((nexIf) && nexAdjust * (4 + PRE));
context.data.SAN.max = (20) + ((nexIf) && nexAdjust * 5);
} else {
console.log(context.data.PV.max);
context.data.PV.max = context.data.PV.max || 0;
context.data.PE.max = context.data.PE.max || 0;
context.data.SAN.max = context.data.SAN.max || 0;
}

// Adicionando os bônus as respectivas variáveis
context.data.PV.max += context.data.PV.maxBonus;
context.data.PE.max += context.data.PE.maxBonus;
context.data.SAN.max += context.data.SAN.maxBonus;

/**
* Faz um loop das perícias e depois faz algumas verificações para definir a formula de rolagem,
* depois disso, salva o valor nas informações
Expand Down
6 changes: 3 additions & 3 deletions template.json
Expand Up @@ -6,18 +6,18 @@
"PV": {
"value": 5,
"max": 10,
"bonus": 0
"maxBonus": 0
},
"SAN": {
"value": 5,
"max": 5,
"bonus": 0
"maxBonus": 0
},
"PE": {
"value": 5,
"max": 5,
"perRound": 1,
"bonus": 0
"maxBonus": 0
},
"NEX": {
"value": 1
Expand Down

0 comments on commit f38a5b7

Please sign in to comment.