SotG Update #1.1 (Quick Fixes)

^ Updates entity.js and starship.js to fix drag-and-drop and NaN errors and prepare for Starship Features.
^ Updates en.json, config.js, sw5e.js, and template.json to prepare for Starship Features.
This commit is contained in:
Professor Bunbury 2021-04-07 14:10:56 -04:00
parent c793949b37
commit f393670528
6 changed files with 25 additions and 8 deletions

View file

@ -317,7 +317,7 @@ export default class Actor5e extends Actor {
const data = actorData.data;
// Proficiency
data.attributes.prof = Math.floor((Math.max(data.details.cr, 1) + 7) / 4);
data.attributes.prof = Math.floor((Math.max(data.details.tier, 1) + 7) / 4);
}
@ -382,7 +382,7 @@ export default class Actor5e extends Actor {
* @private
*/
_computePowercastingProgression (actorData) {
if (actorData.type === 'vehicle') return;
if (actorData.type === 'vehicle' || actorData.type === 'starship') return;
const powers = actorData.data.powers;
const isNPC = actorData.type === 'npc';

View file

@ -38,7 +38,8 @@ export default class ActorSheet5eStarship extends ActorSheet5e {
weapons: { label: game.i18n.localize("SW5E.ItemTypeWeaponPl"), items: [], hasActions: true, dataset: {type: "weapon", "weapon-type": "natural"} },
passive: { label: game.i18n.localize("SW5E.Features"), items: [], dataset: {type: "feat"} },
equipment: { label: game.i18n.localize("SW5E.StarshipEquipment"), items: [], dataset: {type: "equipment"}},
starshipmods: { label: game.i18n.localize("SW5E.ItemTypeStarshipModPl"), items: [], hasActions: false, dataset: {type: "starshipmod"} }
starshipfeatures: { label: game.i18n.localize("SW5E.StarshipfeaturePl"), items: [], hasActions: true, dataset: {type: "starshipfeature"} },
starshipmods: { label: game.i18n.localize("SW5E.StarshipmodPl"), items: [], hasActions: false, dataset: {type: "starshipmod"} }
};
// Start by classifying items into groups for rendering
@ -70,10 +71,13 @@ export default class ActorSheet5eStarship extends ActorSheet5e {
else if ( item.type === "feat" ) {
if ( item.data.activation.type ) features.actions.items.push(item);
else features.passive.items.push(item);
}
}
else if ( item.type === "starshipfeature" ) {
features.starshipfeatures.items.push(item);
}
else if ( item.type === "starshipmod" ) {
features.starshipmods.items.push(item);
}
}
else features.equipment.items.push(item);
}

View file

@ -224,7 +224,9 @@ SW5E.limitedUsePeriods = {
"sr": "SW5E.ShortRest",
"lr": "SW5E.LongRest",
"day": "SW5E.Day",
"charges": "SW5E.Charges"
"charges": "SW5E.Charges",
"recharge": "SW5E.Recharge",
"refitting": "SW5E.Refitting"
};