diff --git a/lang/en.json b/lang/en.json index 7e450f48..b195c39e 100644 --- a/lang/en.json +++ b/lang/en.json @@ -19,7 +19,10 @@ "ITEM.TypeLoot": "Loot", "ITEM.TypePower": "Power", "ITEM.TypeSpecies": "Species", + "ITEM.TypeStarshipfeature": "Starship Feature", + "ITEM.TypeStarshipfeaturePl": "Starship Features", "ITEM.TypeStarshipmod": "Starship Modification", + "ITEM.TypeStarshipmodPl": "Starship Modifications", "ITEM.TypeTool": "Tool", "ITEM.TypeVenture": "Venture", "ITEM.TypeWeapon": "Weapon", @@ -830,6 +833,7 @@ "SW5E.Reaction": "Reaction", "SW5E.ReactionPl": "Reactions", "SW5E.Recharge": "Recharge", + "SW5E.Refitting": "Refitting", "SW5E.RegenerationRateCoefficient": "Regeneration Rate Coefficient", "SW5E.RequiredMaterials": "Required Materials", "SW5E.Requirements": "Requirements", @@ -927,6 +931,8 @@ "SW5E.StarshipArmorandShieldProps": "Starship Armor & Shield Properties", "SW5E.StarshipEquipment": "Starship Equipment", "SW5E.StarshipEquipmentProps": "Starship Equipment Properties", + "SW5E.StarshipfeaturePl": "Starship Features", + "SW5E.StarshipmodPl": "Starship Modifications", "SW5E.StarshipSkillAst": "Astrogation", "SW5E.StarshipSkillBst": "Boost", "SW5E.StarshipSkillDat": "Data", diff --git a/module/actor/entity.js b/module/actor/entity.js index 145e8b59..f23d2240 100644 --- a/module/actor/entity.js +++ b/module/actor/entity.js @@ -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'; diff --git a/module/actor/sheets/newSheet/starship.js b/module/actor/sheets/newSheet/starship.js index 77d58b33..d137ab27 100644 --- a/module/actor/sheets/newSheet/starship.js +++ b/module/actor/sheets/newSheet/starship.js @@ -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); } diff --git a/module/config.js b/module/config.js index d697b6b8..14464286 100644 --- a/module/config.js +++ b/module/config.js @@ -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" }; diff --git a/sw5e.js b/sw5e.js index 66ec9325..3d54b6e9 100644 --- a/sw5e.js +++ b/sw5e.js @@ -136,7 +136,7 @@ Hooks.once("init", function() { }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("sw5e", ItemSheet5e, { - types: ['weapon', 'equipment', 'consumable', 'tool', 'loot', 'class', 'power', 'feat', 'species', 'backpack', 'archetype', 'classfeature', 'background', 'fightingmastery', 'fightingstyle', 'lightsaberform', 'deployment', 'deploymentfeature', 'starshipmod', 'venture'], + types: ['weapon', 'equipment', 'consumable', 'tool', 'loot', 'class', 'power', 'feat', 'species', 'backpack', 'archetype', 'classfeature', 'background', 'fightingmastery', 'fightingstyle', 'lightsaberform', 'deployment', 'deploymentfeature', 'starshipfeature', 'starshipmod', 'venture'], makeDefault: true, label: "SW5E.SheetClassItem" }); diff --git a/template.json b/template.json index 0e86199c..49679290 100644 --- a/template.json +++ b/template.json @@ -541,7 +541,7 @@ } }, "Item": { - "types": ["archetype", "background", "backpack", "class", "classfeature", "consumable", "deployment", "deploymentfeature", "equipment", "feat", "fightingmastery", "fightingstyle", "lightsaberform", "loot", "power", "species", "starshipmod", "tool", "venture", "weapon"], + "types": ["archetype", "background", "backpack", "class", "classfeature", "consumable", "deployment", "deploymentfeature", "equipment", "feat", "fightingmastery", "fightingstyle", "lightsaberform", "loot", "power", "species", "starshipfeature", "starshipmod", "tool", "venture", "weapon"], "templates": { "archetypeDescription": { "className": "", @@ -846,6 +846,11 @@ "mode": "none", "formula": null } + }, + "starshipfeature": { + "templates": ["itemDescription", "activatedEffect", "action"], + "size": "med", + "tier": 0 }, "starshipmod": { "templates": ["itemDescription"]