Skip to content

Commit

Permalink
fix(data migrate): migrate portuguese class names to english class names
Browse files Browse the repository at this point in the history
  • Loading branch information
SouOWendel committed Jan 28, 2024
1 parent 6652a3c commit 7837850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 6 additions & 1 deletion module/documents/actor.mjs
Expand Up @@ -26,12 +26,17 @@ export class OrdemActor extends Actor {
/**
*
*/
_prepareBaseDataAgent(actorData) {
async _prepareBaseDataAgent(actorData) {
if (actorData.type !== 'agent') return;

// Make modifications to data here. For example:
const data = actorData.data;

// TODO: Update portuguese class name for english class name (6.3.1)
if (context.data.class == 'Combatente') await Actor.updateDocuments([{_id: actorData.actor._id, system: {class: 'fighter'}} ]);
if (context.data.class == 'Especialista') await Actor.updateDocuments([{_id: actorData.actor._id, system: {class: 'specialist'}} ]);
if (context.data.class == 'Ocultista') await Actor.updateDocuments([{_id: actorData.actor._id, system: {class: 'occultist'}} ]);

// Loop through ability scores, and add their modifiers to our sheet output.
for (const [keySkill, skillsName] of Object.entries(data.skills)) {

Expand Down
5 changes: 0 additions & 5 deletions module/sheets/actor-sheet.mjs
Expand Up @@ -114,11 +114,6 @@ export class OrdemActorSheet extends ActorSheet {

// DEFININDO STATUS CONFORME A CLASSE

// 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));
Expand Down

0 comments on commit 7837850

Please sign in to comment.