diff --git a/lang/en.json b/lang/en.json index dfce7374..1decdafc 100644 --- a/lang/en.json +++ b/lang/en.json @@ -46,10 +46,10 @@ "SETTINGS.5eReset": "Reset", "SETTINGS.5eRestEpic": "Epic Heroism (LR: 1 hour, SR: 1 min)", "SETTINGS.5eRestGritty": "Gritty Realism (LR: 7 days, SR: 8 hours)", - "SETTINGS.5eUndoChanges": "Undo Changes", "SETTINGS.5eRestL": "Configure which rest variant should be used for games within this system.", "SETTINGS.5eRestN": "Rest Variant", "SETTINGS.5eRestPHB": "Player's Handbook (LR: 8 hours, SR: 1 hour)", + "SETTINGS.5eUndoChanges": "Undo Changes", "SETTINGS.SWColorDark": "Dark Theme", "SETTINGS.SWColorL": "Set the color theme of the game", "SETTINGS.SWColorLight": "Light Theme", @@ -80,6 +80,7 @@ "SW5E.AbilityUseCast": "Cast Power", "SW5E.AbilityUseChargedHint": "This {type} is charged and ready to use!", "SW5E.AbilityUseChargesLabel": "{value} Charges", + "SW5E.AbilityUseConfig": "Usage Configuration", "SW5E.AbilityUseConsumableChargeHint": "Using this {type} will consume 1 charge of {value} remaining.", "SW5E.AbilityUseConsumableDestroyHint": "Using this {type} will consume its final charge and it will be destroyed.", "SW5E.AbilityUseConsumableLabel": "{max} per {per}", @@ -90,7 +91,6 @@ "SW5E.AbilityUseRechargeHint": "This {type} is depleted and must be recharged!", "SW5E.AbilityUseUnavailableHint": "There are no uses of this item remaining!", "SW5E.AbilityUseUse": "Use Ability", - "SW5E.AbilityUseConfig": "Usage Configuration", "SW5E.AbilityWis": "Wisdom", "SW5E.AbilityWisAbbr": "wis", "SW5E.AC": "AC", @@ -110,7 +110,6 @@ "SW5E.ActorWarningInvalidItem": "{itemType} items cannot be added to a {actorType}.", "SW5E.Add": "Add", "SW5E.AddEmbeddedItemPromptHint": "Do you want to add these items to your character sheet?", - "SW5E.SelectItemsPromptTitle": "Select Items", "SW5E.AdditionalNotes": "Additional Notes", "SW5E.Advantage": "Advantage", "SW5E.Alignment": "Alignment", @@ -194,7 +193,7 @@ "SW5E.BonusSaveForm": "Update Bonuses", "SW5E.BonusTechPowerDC": "Global Tech Power DC Bonus", "SW5E.BonusTitle": "Configure Actor Bonuses", - "SW5E.BurnFuel": "Burn", + "SW5E.BurnFuel": "Burn", "SW5E.CapacityMultiplier": "Capacity Multiplier", "SW5E.CentStorageCapacity": "Central Storage Capacity", "SW5E.ChallengeRating": "Challenge Rating", @@ -268,6 +267,10 @@ "SW5E.ConUnconscious": "Unconscious", "SW5E.Core": "Core", "SW5E.CostGP": "Cost (CR)", + "SW5E.Cover": "Cover", + "SW5E.CoverHalf": "Half", + "SW5E.CoverThreeQuarters": "Three Quarters", + "SW5E.CoverTotal": "Total", "SW5E.CreatureAberration": "Aberration", "SW5E.CreatureAberrationPl": "Aberrations", "SW5E.CreatureBeast": "Beast", @@ -282,25 +285,20 @@ "SW5E.CreatureHumanoidPl": "Humanoids", "SW5E.CreaturePlant": "Plant", "SW5E.CreaturePlantPl": "Plants", - "SW5E.CreatureUndead": "Undead", - "SW5E.CreatureUndeadPl": "Undead", - "SW5E.CreatureType": "Creature Type", - "SW5E.CreatureTypeTitle": "Configure Creature Type", "SW5E.CreatureSwarm": "Swarm", - "SW5E.CreatureSwarmSize": "Swarm Size", "SW5E.CreatureSwarmPhrase": "Swarm of {size} {type}", + "SW5E.CreatureSwarmSize": "Swarm Size", + "SW5E.CreatureType": "Creature Type", "SW5E.CreatureTypeConfig": "Configure Creature Type", "SW5E.CreatureTypeSelectorCustom": "Custom Type", "SW5E.CreatureTypeSelectorSubtype": "Subtype", - "SW5E.Crewed": "Crewed", - "SW5E.Cover": "Cover", - "SW5E.CoverHalf": "Half", - "SW5E.CoverThreeQuarters": "Three Quarters", - "SW5E.CoverTotal": "Total", + "SW5E.CreatureTypeTitle": "Configure Creature Type", + "SW5E.CreatureUndead": "Undead", + "SW5E.CreatureUndeadPl": "Undead", "SW5E.CrewCap": "Crew Capacity", + "SW5E.Crewed": "Crewed", "SW5E.Critical": "Critical", "SW5E.CriticalHit": "Critical Hit", - "SW5E.PowerfulCritical": "Powerful Critical", "SW5E.Currency": "Currency", "SW5E.CurrencyConvert": "Convert All Currency", "SW5E.CurrencyConvertHint": "Convert all carried currency to the highest possible denomination to reduce the amount of coinage carried by the character. Be wary, this action cannot be undone.", @@ -320,7 +318,6 @@ "SW5E.DamageRoll": "Damage Roll", "SW5E.DamageSonic": "Sonic", "SW5E.DamImm": "Damage Immunities", - "SW5E.DmgRed": "Damage Reduction", "SW5E.DamRes": "Damage Resistances", "SW5E.DamVuln": "Damage Vulnerabilities", "SW5E.DarkPowerDC": "Dark Power DC", @@ -346,28 +343,29 @@ "SW5E.DistMi": "Miles", "SW5E.DistSelf": "Self", "SW5E.DistTouch": "Touch", + "SW5E.DmgRed": "Damage Reduction", "SW5E.Duration": "Duration", - "SW5E.EffectsCategoryTemporary": "Temporary Effects", - "SW5E.EffectsCategoryPassive": "Passive Effects", - "SW5E.EffectsCategoryInactive": "Inactive Effects", "SW5E.EffectCreate": "Create Effect", "SW5E.EffectDelete": "Delete Effect", - "SW5E.EffectTemporary": "Temporary Effects", - "SW5E.EffectPassive": "Passive Effects", + "SW5E.EffectEdit": "Edit Effect", "SW5E.EffectInactive": "Inactive Effects", "SW5E.EffectNew": "New Effect", - "SW5E.EffectEdit": "Edit Effect", + "SW5E.EffectPassive": "Passive Effects", "SW5E.Effects": "Effects", + "SW5E.EffectTemporary": "Temporary Effects", + "SW5E.EffectsCategoryInactive": "Inactive Effects", + "SW5E.EffectsCategoryPassive": "Passive Effects", + "SW5E.EffectsCategoryTemporary": "Temporary Effects", "SW5E.EffectToggle": "Toggle Effect", "SW5E.Engine": "Engine", "SW5E.EnginePl": "Engines", "SW5E.EquipmentBonus": "Magical Bonus", "SW5E.EquipmentClothing": "Clothing", "SW5E.EquipmentHeavy": "Heavy Armor", + "SW5E.EquipmentHyperdrive": "Hyperdrive", "SW5E.EquipmentLight": "Light Armor", "SW5E.EquipmentMedium": "Medium Armor", "SW5E.EquipmentNatural": "Natural Armor", - "SW5E.EquipmentHyperdrive": "Hyperdrive", "SW5E.EquipmentPowerCoupling": "Power Coupling", "SW5E.EquipmentReactor": "Reactor", "SW5E.EquipmentShield": "Shield", @@ -382,6 +380,7 @@ "SW5E.Expertise": "Expertise", "SW5E.Favorites": "Favorites", "SW5E.FavoritesAndNotes": "Favorites & Notes", + "SW5E.Feats": "Feats", "SW5E.FeatureActionRecharge": "Action Recharge", "SW5E.FeatureActive": "Active Abilities", "SW5E.FeatureAdd": "Create Feature", @@ -392,9 +391,8 @@ "SW5E.FeatureRechargeOn": "Recharge On", "SW5E.FeatureRechargeResult": "1d6 Result", "SW5E.Features": "Features", - "SW5E.Feats": "Feats", - "SW5E.FeatureUsage": "Feature Usage", "SW5E.FeatureType": "Feature Type", + "SW5E.FeatureUsage": "Feature Usage", "SW5E.FeetAbbr": "ft.", "SW5E.Filter": "Filter", "SW5E.FilterNoPowers": "No powers found for this set of filters.", @@ -523,9 +521,9 @@ "SW5E.Flaws": "Flaws", "SW5E.ForcePowerbook": "Force Powers", "SW5E.Formula": "Formula", - "SW5E.FuelCapacity": "Fuel Capacity", + "SW5E.FuelCapacity": "Fuel Capacity", + "SW5E.FuelCostPerUnit": "Fuel Cost per Unit", "SW5E.FuelCostsMod": "Fuel Costs Modifier", - "SW5E.FuelCostPerUnit": "Fuel Cost per Unit", "SW5E.GrantedAbilities": "Granted Abilities", "SW5E.HalfProficient": "Half Proficient", "SW5E.HardpointSizeMod": "Hardpoint Size Modifier", @@ -591,6 +589,7 @@ "SW5E.ItemTypeArchetype": "Archetype", "SW5E.ItemTypeBackground": "Background", "Sw5E.ItemTypeBackgroundPl": "Backgrounds", + "SW5E.ItemTypeBackpack": "Container", "SW5E.ItemTypeClass": "Class", "SW5E.ItemTypeClassFeat": "Class Feature", "SW5E.ItemTypeClassFeats": "Class Features", @@ -598,12 +597,11 @@ "SW5E.ItemTypeConsumable": "Consumable", "SW5E.ItemTypeConsumablePl": "Consumables", "SW5E.ItemTypeContainer": "Container", - "SW5E.ItemTypeBackpack": "Container", "SW5E.ItemTypeContainerPl": "Containers", "SW5E.ItemTypeDeployment": "Deployment", - "SW5E.ItemTypeDeploymentPl": "Deployments", "SW5E.ItemTypeDeploymentFeature": "Deployment Feature", "SW5E.ItemTypeDeploymentFeaturePl": "Deployment Features", + "SW5E.ItemTypeDeploymentPl": "Deployments", "SW5E.ItemTypeEquipment": "Equipment", "SW5E.ItemTypeEquipmentPl": "Equipment", "SW5E.ItemTypeFeat": "Feat", @@ -758,9 +756,9 @@ "SW5E.LongRest": "Long Rest", "SW5E.LongRestEpic": "Long Rest (1 hour)", "SW5E.LongRestGritty": "Long Rest (7 days)", + "SW5E.LongRestHint": "Take a long rest? On a long rest you will recover hit points, half your maximum hit dice, class resources, limited use item charges, and power points.", "SW5E.LongRestNormal": "Long Rest (8 hours)", "SW5E.LongRestOvernight": "Long Rest (New Day)", - "SW5E.LongRestHint": "Take a long rest? On a long rest you will recover hit points, half your maximum hit dice, class resources, limited use item charges, and power points.", "SW5E.LongRestResult": "{name} takes a long rest.", "SW5E.LongRestResultFP": "{name} takes a long rest and recovers {force} Force Points.", "SW5E.LongRestResultFPHD": "{name} takes a long rest and recovers {force} Force Points and {dice} Hit Dice.", @@ -778,8 +776,8 @@ "SW5E.LongRestResultTP": "{name} takes a long rest and recovers {tech} Tech Points.", "SW5E.LongRestResultTPHD": "{name} takes a long rest and recovers {tech} Tech Points and {dice} Hit Dice.", "SW5E.Max": "Max", - "SW5E.Modifier": "Modifier", "SW5E.ModCap": "Modification Capacity", + "SW5E.Modifier": "Modifier", "SW5E.Movement": "Movement", "SW5E.MovementBurrow": "Burrow", "SW5E.MovementClimb": "Climb", @@ -788,15 +786,15 @@ "SW5E.MovementCrawl": "Crawl", "SW5E.MovementFly": "Fly", "SW5E.MovementHover": "Hover", - "SW5E.MovementRoll": "Roll", - "SW5E.MovementSpace": "Space Flight", + "SW5E.MovementRoll": "Roll", + "SW5E.MovementSpace": "Space Flight", "SW5E.MovementSwim": "Swim", "SW5E.MovementTurn": "Turning", "SW5E.MovementUnits": "Units", "SW5E.MovementWalk": "Walk", + "SW5E.Name": "Character Name", "SW5E.NewDay": "Is New Day?", "SW5E.NewDayHint": "Recover limited use abilities which recharge \"per day\"?", - "SW5E.Name": "Character Name", "SW5E.NoCharges": "No Charges", "SW5E.None": "None", "SW5E.NoPowerLevels": "This character has no powercaster levels, but you may add powers manually.", @@ -849,11 +847,12 @@ "SW5E.PowerCreate": "Create Power", "SW5E.PowerDC": "Power DC", "SW5E.PowerDetails": "Power Details", - "SW5E.PowerDie": "Power Die", - "SW5E.PowerDiePl": "Power Dice", - "SW5E.PowerDieAlloc": "Power Die Allocation", "SW5E.PowerDiceRecovery": "Power Dice Recovery", + "SW5E.PowerDie": "Power Die", + "SW5E.PowerDieAlloc": "Power Die Allocation", + "SW5E.PowerDiePl": "Power Dice", "SW5E.PowerEffects": "Power Effects", + "SW5E.PowerfulCritical": "Powerful Critical", "SW5E.PowerLevel": "Power Level", "SW5E.PowerLevel0": "At-Will", "SW5E.PowerLevel1": "1st Level", @@ -883,9 +882,9 @@ "SW5E.PowerProgression": "Power Progression", "SW5E.PowerProgSct": "Scout", "SW5E.PowerProgSnt": "Sentinel", + "SW5E.PowerRouting": "Power Routing", "SW5E.PowerSchool": "Power School", "SW5E.PowersKnown": "Powers Known", - "SW5E.PowerRouting": "Power Routing", "SW5E.PowerTarget": "Power Target", "SW5E.PowerUnprepared": "Unprepared", "SW5E.PowerUsage": "Power Usage", @@ -901,13 +900,13 @@ "SW5E.Reaction": "Reaction", "SW5E.ReactionPl": "Reactions", "SW5E.Recharge": "Recharge", - "SW5E.Refitting": "Refitting", - "SW5E.Refuel": "Refuel", + "SW5E.Refitting": "Refitting", + "SW5E.Refuel": "Refuel", "SW5E.RegenerationRateCoefficient": "Regeneration Rate Coefficient", "SW5E.RequiredMaterials": "Required Materials", "SW5E.Requirements": "Requirements", - "SW5E.ResourcesAndTraits": "Resources & Traits", "SW5E.ResourcePrimary": "Resource 1", + "SW5E.ResourcesAndTraits": "Resources & Traits", "SW5E.ResourceSecondary": "Resource 2", "SW5E.ResourceTertiary": "Resource 3", "SW5E.Rest": "Rest", @@ -930,6 +929,7 @@ "SW5E.SchoolLgt": "Light", "SW5E.SchoolTec": "Tech", "SW5E.SchoolUni": "Universal", + "SW5E.SelectItemsPromptTitle": "Select Items", "SW5E.SenseBlindsight": "Blindsight", "SW5E.SenseBS": "Blindsight", "SW5E.SenseDarkvision": "Darkvision", @@ -948,10 +948,10 @@ "SW5E.SheetClassNPC": "Default NPC Sheet", "SW5E.SheetClassNPCOld": "Old NPC Sheet", "SW5E.SheetClassVehicle": "Default Vehicle Sheet", - "SW5E.ShieldDice": "Shield Dice", - "SW5E.ShieldPoints": "Shield Points", - "SW5E.ShieldPointsFormula": "Shield Points Formula", - "SW5E.ShieldRegen": "Regen", + "SW5E.ShieldDice": "Shield Dice", + "SW5E.ShieldPoints": "Shield Points", + "SW5E.ShieldPointsFormula": "Shield Points Formula", + "SW5E.ShieldRegen": "Regen", "SW5E.ShortRest": "Short Rest", "SW5E.ShortRestEpic": "Short Rest (5 minutes)", "SW5E.ShortRestGritty": "Short Rest (8 hours)", @@ -986,12 +986,12 @@ "SW5E.SkillPrc": "Perception", "SW5E.SkillPrf": "Performance", "SW5E.SkillPromptTitle": "{skill} Skill Check", - "SW5E.Skip": "Skip", "SW5E.Skills": "Skills", "SW5E.SkillSlt": "Sleight of Hand", "SW5E.SkillSte": "Stealth", "SW5E.SkillSur": "Survival", "SW5E.SkillTec": "Technology", + "SW5E.Skip": "Skip", "SW5E.Slots": "Slots", "SW5E.Source": "Source", "SW5E.Special": "Special", @@ -1002,8 +1002,8 @@ "SW5E.Speed": "Speed", "SW5E.SpeedSpecial": "Special Movement", "SW5E.StarshipAmbassador": "Ambassador", - "SW5E.StarshipArmorandShields": "Starship Armor and Shields", "SW5E.StarshipArmorandShieldProps": "Starship Armor & Shield Properties", + "SW5E.StarshipArmorandShields": "Starship Armor and Shields", "SW5E.StarshipBattleship": "Battleship", "SW5E.StarshipBlockadeShip": "Blockade Ship", "SW5E.StarshipBomber": "Bomber", @@ -1128,6 +1128,7 @@ "SW5E.TraitToolProf": "Tool Proficiencies", "SW5E.TraitWeaponProf": "Weapon Proficiencies", "SW5E.Type": "Type", + "SW5E.Uncrewed": "Uncrewed", "SW5E.Unequipped": "Unequipped", "SW5E.UniversalPowerDC": "Universal Power DC", "SW5E.Unlimited": "Unlimited", @@ -1152,16 +1153,27 @@ "SW5E.VersatileDamage": "Versatile Damage", "SW5E.VsDC": "vs DC.", "SW5E.WeaponAmmo": "Ammunition", + "SW5E.WeaponBlasterPistolProficiency": "Blaster Pistol", + "SW5E.WeaponChakramProficiency": "Chakrams", + "SW5E.WeaponDoubleBladeProficiency": "Doubleblade", + "SW5E.WeaponDoubleSaberProficiency": "Doublesaber", + "SW5E.WeaponDoubleShotoProficiency": "Doubleshoto", + "SW5E.WeaponDoubleSwordProficiency": "Doublesword", + "SW5E.WeaponHiddenBladeProficiency": "Hidden Blade", "SW5E.WeaponImprov": "Improvised", + "SW5E.WeaponImprovisedProficiency": "Improvised Weapons", + "SW5E.WeaponLightFoilProficiency": "Lightfoil", + "SW5E.WeaponLightRingProficiency": "Light Ring", "SW5E.WeaponMartialB": "Martial Blaster", + "SW5E.WeaponMartialBlasterProficiency": "Martial Blasters", + "SW5E.WeaponMartialLightweaponProficiency": "Martial Lightweapons", "SW5E.WeaponMartialLW": "Martial Lightweapon", - "SW5E.WeaponPrimarySW": "Primary (Starship)", - "SW5E.WeaponSecondarySW": "Secondary (Starship)", - "SW5E.WeaponTertiarySW": "Tertiary (Starship)", - "SW5E.WeaponQuaternarySW": "Quaternary (Starship)", "SW5E.WeaponMartialProficiency": "Martial Weapons", + "SW5E.WeaponMartialVibroweaponProficiency": "Martial Vibroweapons", "SW5E.WeaponMartialVW": "Martial Vibroweapon", "SW5E.WeaponNatural": "Natural", + "SW5E.WeaponNaturalProficiency": "Natural Weapons", + "SW5E.WeaponPrimarySW": "Primary (Starship)", "SW5E.WeaponPropertiesAmm": "Ammunition", "SW5E.WeaponPropertiesAut": "Auto", "SW5E.WeaponPropertiesBur": "Burst", @@ -1179,14 +1191,14 @@ "SW5E.WeaponPropertiesFix": "Fixed", "SW5E.WeaponPropertiesFoc": "Focus", "SW5E.WeaponPropertiesHid": "Hidden", - "SW5E.WeaponPropertiesHvy": "Heavy", "SW5E.WeaponPropertiesHom": "Homing", + "SW5E.WeaponPropertiesHvy": "Heavy", "SW5E.WeaponPropertiesIon": "Ionizing", "SW5E.WeaponPropertiesKen": "Keen", "SW5E.WeaponPropertiesLgt": "Light", "SW5E.WeaponPropertiesLum": "Luminous", - "SW5E.WeaponPropertiesMlt": "Melt", "SW5E.WeaponPropertiesMig": "Mighty", + "SW5E.WeaponPropertiesMlt": "Melt", "SW5E.WeaponPropertiesOvr": "Overheat", "SW5E.WeaponPropertiesPic": "Piercing", "SW5E.WeaponPropertiesPow": "Power", @@ -1205,32 +1217,21 @@ "SW5E.WeaponPropertiesVer": "Versatile", "SW5E.WeaponPropertiesVic": "Vicious", "SW5E.WeaponPropertiesZon": "Zone", + "SW5E.WeaponQuaternarySW": "Quaternary (Starship)", + "SW5E.WeaponSaberWhipProficiency": "Saberwhip", + "SW5E.WeaponSecondarySW": "Secondary (Starship)", "SW5E.WeaponSiege": "Siege", "SW5E.WeaponSimpleB": "Simple Blaster", + "SW5E.WeaponSimpleBlasterProficiency": "Simple Blasters", + "SW5E.WeaponSimpleLightweaponProficiency": "Simple Lightweapons", "SW5E.WeaponSimpleLW": "Simple Lightweapon", - "SW5E.WeaponBlasterPistolProficiency": "Blaster Pistol", - "SW5E.WeaponChakramProficiency": "Chakrams", - "SW5E.WeaponDoubleBladeProficiency": "Doubleblade", - "SW5E.WeaponDoubleSaberProficiency": "Doublesaber", - "SW5E.WeaponDoubleShotoProficiency": "Doubleshoto", - "SW5E.WeaponDoubleSwordProficiency": "Doublesword", - "SW5E.WeaponHiddenBladeProficiency": "Hidden Blade", - "SW5E.WeaponImprovisedProficiency": "Improvised Weapons", "SW5E.WeaponSimpleProficiency": "Simple Weapons", - "SW5E.WeaponLightFoilProficiency": "Lightfoil", - "SW5E.WeaponLightRingProficiency": "Light Ring", - "SW5E.WeaponMartialBlasterProficiency": "Martial Blasters", - "SW5E.WeaponMartialLightweaponProficiency": "Martial Lightweapons", - "SW5E.WeaponMartialVibroweaponProficiency": "Martial Vibroweapons", - "SW5E.WeaponNaturalProficiency": "Natural Weapons", - "SW5E.WeaponSaberWhipProficiency": "Saberwhip", - "SW5E.WeaponSimpleBlasterProficiency": "Simple Blasters", - "SW5E.WeaponSimpleLightweaponProficiency": "Simple Lightweapons", - "SW5E.WeaponSimpleVibroweaponProficiency": "Simple Vibroweapons", + "SW5E.WeaponSimpleVibroweaponProficiency": "Simple Vibroweapons", "SW5E.WeaponSimpleVW": "Simple Vibroweapon", - "SW5E.WeaponTechbladeProficiency": "Techblades", - "SW5E.WeaponVibrorapierProficiency": "Vibrorapier", - "SW5E.WeaponVibrowhipProficiency": "Vibrowhip", "SW5E.WeaponSizeAbb": "Size", + "SW5E.WeaponTechbladeProficiency": "Techblades", + "SW5E.WeaponTertiarySW": "Tertiary (Starship)", + "SW5E.WeaponVibrorapierProficiency": "Vibrorapier", + "SW5E.WeaponVibrowhipProficiency": "Vibrowhip", "SW5E.Weight": "Weight" } \ No newline at end of file diff --git a/module/actor/entity.js b/module/actor/entity.js index d0aafc84..356ecb12 100644 --- a/module/actor/entity.js +++ b/module/actor/entity.js @@ -696,10 +696,10 @@ export default class Actor5e extends Actor { } /* -------------------------------------------- */ - /* Event Handlers + /* Event Handlers */ /* -------------------------------------------- */ - /** @inheritDoc */ + /** @inheritdoc */ async _preCreate(data, options, user) { await super._preCreate(data, options, user); diff --git a/module/actor/sheets/newSheet/base.js b/module/actor/sheets/newSheet/base.js index 65a4bd6e..ff0d483f 100644 --- a/module/actor/sheets/newSheet/base.js +++ b/module/actor/sheets/newSheet/base.js @@ -75,10 +75,10 @@ export default class ActorSheet5e extends ActorSheet { options: this.options, editable: this.isEditable, cssClass: isOwner ? "editable" : "locked", - isCharacter: this.actor.data.type === "character", - isNPC: this.actor.data.type === "npc", - isStarship: this.actor.data.type === "starship", - isVehicle: this.actor.data.type === 'vehicle', + isCharacter: this.actor.type === "character", + isNPC: this.actor.type === "npc", + isStarship: this.actor.type === "starship", + isVehicle: this.actor.type === 'vehicle', config: CONFIG.SW5E, rollData: this.actor.getRollData.bind(this.actor) }; @@ -109,7 +109,7 @@ export default class ActorSheet5e extends ActorSheet { // Skills if (actorData.data.skills) { - for ( let [s, skl] of Object.entries(actorData.data.skills)) { + for (let [s, skl] of Object.entries(actorData.data.skills)) { skl.ability = CONFIG.SW5E.abilityAbbreviations[skl.ability]; skl.icon = this._getProficiencyIcon(skl.value); skl.hover = CONFIG.SW5E.proficiencyLevels[skl.value]; diff --git a/module/actor/sheets/newSheet/character.js b/module/actor/sheets/newSheet/character.js index 58176a54..3390c482 100644 --- a/module/actor/sheets/newSheet/character.js +++ b/module/actor/sheets/newSheet/character.js @@ -112,7 +112,7 @@ export default class ActorSheet5eCharacterNew extends ActorSheet5e { this._prepareItemToggleState(item); // Primary Class - if ( item.type === "class" ) item.isOriginalClass = ( item.data._id === this.actor.data.data.details.originalClass ); + if ( item.type === "class" ) item.isOriginalClass = ( item._id === this.actor.data.data.details.originalClass ); // Classify items into types if ( item.type === "power" && ["lgt", "drk", "uni"].includes(item.data.school) ) arr[1].push(item); @@ -143,7 +143,7 @@ export default class ActorSheet5eCharacterNew extends ActorSheet5e { for ( let i of items ) { i.data.quantity = i.data.quantity || 0; i.data.weight = i.data.weight || 0; - i.totalWeight = Math.round(i.data.quantity * i.data.weight * 10) / 10; + i.totalWeight = (i.data.quantity * i.data.weight).toNearest(0.1); inventory[i.type].items.push(i); } @@ -156,9 +156,9 @@ export default class ActorSheet5eCharacterNew extends ActorSheet5e { classes: { label: "SW5E.ItemTypeClassPl", items: [], hasActions: false, dataset: {type: "class"}, isClass: true }, classfeatures: { label: "SW5E.ItemTypeClassFeats", items: [], hasActions: true, dataset: {type: "classfeature"}, isClassfeature: true }, archetype: { label: "SW5E.ItemTypeArchetype", items: [], hasActions: false, dataset: {type: "archetype"}, isArchetype: true }, - deployments: { label: "SW5E.ItemTypeDeploymentPl", items: [], hasActions: false, dataset: {type: "deployment"}, isDeployment: true }, - deploymentfeatures: { label: "SW5E.ItemTypeDeploymentFeaturePl", items: [], hasActions: true, dataset: {type: "deploymentfeature"}, isDeploymentfeature: true }, - ventures: { label: "SW5E.ItemTypeVenturePl", items: [], hasActions: false, dataset: {type: "venture"}, isVenture: true }, + deployments: { label: "SW5E.ItemTypeDeploymentPl", items: [], hasActions: false, dataset: {type: "deployment"}, isDeployment: true }, + deploymentfeatures: { label: "SW5E.ItemTypeDeploymentFeaturePl", items: [], hasActions: true, dataset: {type: "deploymentfeature"}, isDeploymentfeature: true }, + ventures: { label: "SW5E.ItemTypeVenturePl", items: [], hasActions: false, dataset: {type: "venture"}, isVenture: true }, species: { label: "SW5E.ItemTypeSpecies", items: [], hasActions: false, dataset: {type: "species"}, isSpecies: true }, background: { label: "SW5E.ItemTypeBackground", items: [], hasActions: false, dataset: {type: "background"}, isBackground: true }, fightingstyles: { label: "SW5E.ItemTypeFightingStylePl", items: [], hasActions: false, dataset: {type: "fightingstyle"}, isFightingstyle: true }, @@ -175,9 +175,9 @@ export default class ActorSheet5eCharacterNew extends ActorSheet5e { features.classes.items = classes; features.classfeatures.items = classfeatures; features.archetype.items = archetypes; - features.deployments.items = deployments; - features.deploymentfeatures.items = deploymentfeatures; - features.ventures.items = ventures; + features.deployments.items = deployments; + features.deploymentfeatures.items = deploymentfeatures; + features.ventures.items = ventures; features.species.items = species; features.background.items = backgrounds; features.fightingstyles.items = fightingstyles; diff --git a/module/actor/sheets/newSheet/npc.js b/module/actor/sheets/newSheet/npc.js index dea59e8f..486dbf99 100644 --- a/module/actor/sheets/newSheet/npc.js +++ b/module/actor/sheets/newSheet/npc.js @@ -1,4 +1,4 @@ -import Actor5e from "../../entity.js"; +import Actor5e from "../entity.js"; import ActorSheet5e from "./base.js"; /** @@ -88,7 +88,7 @@ export default class ActorSheet5eNPCNew extends ActorSheet5e { /* -------------------------------------------- */ - /** @override */ + /** @inheritdoc */ getData(options) { const data = super.getData(options); diff --git a/module/actor/sheets/newSheet/vehicle.js b/module/actor/sheets/newSheet/vehicle.js index aea7f402..b5e28a1c 100644 --- a/module/actor/sheets/newSheet/vehicle.js +++ b/module/actor/sheets/newSheet/vehicle.js @@ -222,7 +222,7 @@ export default class ActorSheet5eVehicle extends ActorSheet5e { if ( isCargo ) { totalWeight += (item.data.weight || 0) * item.data.quantity; cargo.cargo.items.push(item); - continue + continue; } // Handle non-cargo item types @@ -371,6 +371,8 @@ export default class ActorSheet5eVehicle extends ActorSheet5e { return super._onItemDelete(event); } + /* -------------------------------------------- */ + /** @override */ async _onDropItemCreate(itemData) { const cargoTypes = ["weapon", "equipment", "consumable", "tool", "loot", "backpack"]; diff --git a/module/actor/sheets/oldSheets/base.js b/module/actor/sheets/oldSheets/base.js index 2fccb001..f0a7a83b 100644 --- a/module/actor/sheets/oldSheets/base.js +++ b/module/actor/sheets/oldSheets/base.js @@ -789,7 +789,7 @@ export default class ActorSheet5e extends ActorSheet { const header = event.currentTarget; const type = header.dataset.type; const itemData = { - name: game.i18n.format("SW5E.ItemNew", {type: type.capitalize()}), + name: game.i18n.format("SW5E.ItemNew", {type: game.i18n.localize(`SW5E.ItemType${type.capitalize()}`)}), type: type, data: foundry.utils.deepClone(header.dataset) }; @@ -820,6 +820,7 @@ export default class ActorSheet5e extends ActorSheet { */ _onItemDelete(event) { event.preventDefault(); + const li = event.currentTarget.closest(".item"); const item = this.actor.items.get(li.dataset.itemId); if ( item ) return item.delete(); } diff --git a/module/actor/sheets/oldSheets/character.js b/module/actor/sheets/oldSheets/character.js index bbd41b8e..dd82ecfe 100644 --- a/module/actor/sheets/oldSheets/character.js +++ b/module/actor/sheets/oldSheets/character.js @@ -101,7 +101,7 @@ export default class ActorSheet5eCharacter extends ActorSheet5e { this._prepareItemToggleState(item); // Primary Class - if ( item.type === "class" ) item.isOriginalClass = ( item.data._id === this.actor.data.data.details.originalClass ); + if ( item.type === "class" ) item.isOriginalClass = ( item._id === this.actor.data.data.details.originalClass ); // Classify items into types if ( item.type === "power" ) arr[1].push(item); diff --git a/module/actor/sheets/oldSheets/npc.js b/module/actor/sheets/oldSheets/npc.js index 12e85b1f..29c81993 100644 --- a/module/actor/sheets/oldSheets/npc.js +++ b/module/actor/sheets/oldSheets/npc.js @@ -1,3 +1,4 @@ +import Actor5e from "../entity.js"; import ActorSheet5e from "./base.js"; /** diff --git a/module/apps/actor-flags.js b/module/apps/actor-flags.js index d4599996..cb3a816c 100644 --- a/module/apps/actor-flags.js +++ b/module/apps/actor-flags.js @@ -1,6 +1,6 @@ /** * An application class which provides advanced configuration for special character flags which modify an Actor - * @extends {DocumentSheet} + * @implements {DocumentSheet} */ export default class ActorSheetFlags extends DocumentSheet { static get defaultOptions() { diff --git a/module/apps/senses-config.js b/module/apps/senses-config.js index 69309493..707ca7fb 100644 --- a/module/apps/senses-config.js +++ b/module/apps/senses-config.js @@ -1,5 +1,5 @@ /** - * A simple form to set actor movement speeds + * A simple form to set Actor movement speeds. * @extends {DocumentSheet} */ export default class ActorSensesConfig extends DocumentSheet { diff --git a/module/apps/trait-selector.js b/module/apps/trait-selector.js index 5550aa3e..ef3c82c1 100644 --- a/module/apps/trait-selector.js +++ b/module/apps/trait-selector.js @@ -4,7 +4,7 @@ */ export default class TraitSelector extends DocumentSheet { - /** @inheritDoc */ + /** @inheritdoc */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { id: "trait-selector", diff --git a/module/config.js b/module/config.js index c2696683..d0991cb5 100644 --- a/module/config.js +++ b/module/config.js @@ -110,19 +110,13 @@ SW5E.weaponProficiencies = { */ SW5E.weaponProficienciesMap = { "natural": true, - "simpleB": "sim", "simpleVW": "sim", + "simpleB": "sim", "simpleLW": "sim", - "martialB": "mar", "martialVW": "mar", - "martialLW": "mar", - - // "simpleM": "sim", - // "simpleR": "sim", - // "martialM": "mar", - // "martialR": "mar" -} - + "martialB": "mar", + "martialLW": "mar" +}; // TODO: Check to see if this can be used // It's not actually been used anywhere in DND5e 1.3.2 @@ -439,7 +433,7 @@ SW5E.armorProficiencies = { * Used when a new player owned item is created * @type {Object} */ -SW5E.armorProficienciesMap = { + SW5E.armorProficienciesMap = { "natural": true, "clothing": true, "light": "lgt", @@ -780,7 +774,7 @@ SW5E.starshipRolesgrg = { /** * The set of possible sensory perception types which an Actor may have - * @type {object} + * @enum {string} */ SW5E.senses = { "blindsight": "SW5E.SenseBlindsight", diff --git a/module/dice.js b/module/dice.js index 7d3c2489..fc70522b 100644 --- a/module/dice.js +++ b/module/dice.js @@ -42,7 +42,14 @@ export function simplifyRollFormula(formula, data, {constantFirst = false} = {}) const rollableFormula = Roll.getFormula(rollableTerms); // Cleans up the non-constant terms and produces a new formula string // Mathematically evaluate the constant formula to produce a single constant term - const constantPart = constantFormula ? Roll.safeEval(constantFormula) : undefined; + let constantPart = undefined; + if ( constantFormula ) { + try { + constantPart = Roll.safeEval(constantFormula) + } catch (err) { + console.warn(`Unable to evaluate constant term ${constantFormula} in simplifyRollFormula`); + } + } // Order the rollable and constant terms, either constant first or second depending on the optional argument const parts = constantFirst ? [constantPart, rollableFormula] : [rollableFormula, constantPart]; diff --git a/module/item/entity.js b/module/item/entity.js index d39f53b1..cf6374e5 100644 --- a/module/item/entity.js +++ b/module/item/entity.js @@ -255,7 +255,7 @@ export default class Item5e extends Item { // Range Label let rng = data.range || {}; - if (["none", "touch", "self"].includes(rng.units) || (rng.value === 0)) { + if ( ["none", "touch", "self"].includes(rng.units) ) { rng.value = null; rng.long = null; } diff --git a/module/item/sheet.js b/module/item/sheet.js index 556032e7..87d67d7e 100644 --- a/module/item/sheet.js +++ b/module/item/sheet.js @@ -56,7 +56,7 @@ export default class ItemSheet5e extends ItemSheet { // Potential consumption targets data.abilityConsumptionTargets = this._getItemConsumptionTargets(itemData); - // Action Detail + // Action Details data.hasAttackRoll = this.item.hasAttack; data.isHealing = itemData.data.actionType === "heal"; data.isFlatDC = getProperty(itemData, "data.save.scaling") === "flat"; diff --git a/module/migration.js b/module/migration.js index ba772a1b..2867e191 100644 --- a/module/migration.js +++ b/module/migration.js @@ -142,7 +142,7 @@ export const migrateActorData = async function(actor) { const results = await memo; // Migrate the Owned Item - const itemData = i instanceof CONFIG.Item.documentClass ? i.toObject() : i + const itemData = i instanceof CONFIG.Item.documentClass ? i.toObject() : i; let itemUpdate = await migrateActorItemData(itemData, actor); // Prepared, Equipped, and Proficient for NPC actors @@ -154,7 +154,7 @@ export const migrateActorData = async function(actor) { // Update the Owned Item if ( !isObjectEmpty(itemUpdate) ) { - itemUpdate._id = itemData.id; + itemUpdate._id = itemData._id; console.log(`Migrating Actor ${actor.name}'s ${i.name}`); results.push(expandObject(itemUpdate)); } @@ -208,12 +208,15 @@ function cleanActorData(actorData) { /** * Migrate a single Item entity to incorporate latest data model changes - * @param item + * + * @param {object} item Item data to migrate + * @return {object} The updateData to apply */ export const migrateItemData = function(item) { const updateData = {}; _migrateItemClassPowerCasting(item, updateData); _migrateItemAttunement(item, updateData); + _migrateItemPowercasting(item, updateData); return updateData; }; @@ -228,6 +231,7 @@ export const migrateActorItemData = async function(item, actor) { const updateData = {}; _migrateItemClassPowerCasting(item, updateData); _migrateItemAttunement(item, updateData); + _migrateItemPowercasting(item, updateData); await _migrateItemPower(item, actor, updateData); return updateData; }; @@ -464,6 +468,8 @@ function _migrateActorSenses(actor, updateData) { return updateData; } +/* -------------------------------------------- */ + /** * Migrate the actor details.type string to object * @private @@ -643,12 +649,32 @@ async function _migrateItemPower(item, actor, updateData) { * @private */ function _migrateItemAttunement(item, updateData) { - if ( item.data.data.attuned === undefined ) return updateData; + if ( item.data?.attuned === undefined ) return updateData; updateData["data.attunement"] = CONFIG.SW5E.attunementTypes.NONE; updateData["data.-=attuned"] = null; return updateData; } +/* -------------------------------------------- */ + +/** + * Replace class powercasting string to object. + * + * @param {object} item Item data to migrate + * @param {object} updateData Existing update to expand upon + * @return {object} The updateData to apply + * @private + */ + function _migrateItemPowercasting(item, updateData) { + if ( item.type !== "class" || (foundry.utils.getType(item.data.powercasting) === "Object") ) return updateData; + updateData["data.powercasting"] = { + progression: item.data.powercasting, + ability: "" + }; + return updateData; +} + + /* -------------------------------------------- */ /** diff --git a/sw5e.js b/sw5e.js index 3389f0b7..5bef2a6f 100644 --- a/sw5e.js +++ b/sw5e.js @@ -218,7 +218,7 @@ Hooks.once("ready", function() { // Determine whether a system migration is required and feasible if ( !game.user.isGM ) return; const currentVersion = game.settings.get("sw5e", "systemMigrationVersion"); - const NEEDS_MIGRATION_VERSION = "1.3.0.R1-A6"; + const NEEDS_MIGRATION_VERSION = "1.3.5.R1-A6"; // Check for R1 SW5E versions const SW5E_NEEDS_MIGRATION_VERSION = "R1-A6"; const COMPATIBLE_MIGRATION_VERSION = 0.80; diff --git a/system.json b/system.json index 39760b3f..ac8b4dc2 100644 --- a/system.json +++ b/system.json @@ -151,7 +151,7 @@ "gridUnits": "ft", "primaryTokenAttribute": "attributes.hp", "secondaryTokenAttribute": null, - "minimumCoreVersion": "0.8.3", + "minimumCoreVersion": "0.8.2", "compatibleCoreVersion": "0.8.7", "url": "https://github.com/unrealkakeman89/sw5e", "manifest": "https://raw.githubusercontent.com/unrealkakeman89/sw5e/master/system.json", diff --git a/templates/actors/newActor/parts/swalt-active-effects.html b/templates/actors/newActor/parts/swalt-active-effects.html index d712928d..70be6e1b 100644 --- a/templates/actors/newActor/parts/swalt-active-effects.html +++ b/templates/actors/newActor/parts/swalt-active-effects.html @@ -3,8 +3,8 @@ {{#each effects as |section sid|}}
  • {{localize section.label}}

    -
    Source
    -
    Duration
    +
    {{localize "SW5E.Source"}}
    +
    {{localize "SW5E.Duration"}}
    {{localize "SW5E.Add"}} diff --git a/templates/actors/newActor/parts/swalt-core.html b/templates/actors/newActor/parts/swalt-core.html index d2dccbe5..0f8a1dfe 100644 --- a/templates/actors/newActor/parts/swalt-core.html +++ b/templates/actors/newActor/parts/swalt-core.html @@ -10,7 +10,7 @@ value="{{ability.value}}" data-dtype="Number" placeholder="10" /> {{/if}}
  • diff --git a/templates/actors/newActor/parts/swalt-features.html b/templates/actors/newActor/parts/swalt-features.html index 16c50787..5c7d9b63 100644 --- a/templates/actors/newActor/parts/swalt-features.html +++ b/templates/actors/newActor/parts/swalt-features.html @@ -38,8 +38,11 @@ {{#each section.items as |item iid|}}
  • -
    -

    {{item.name}}

    +
    +

    + {{item.name}} + {{#if item.isOriginalClass}} {{/if}} +

    {{#if section.hasActions}} diff --git a/templates/actors/newActor/parts/swalt-inventory.html b/templates/actors/newActor/parts/swalt-inventory.html index c1f835c8..b7dd1284 100644 --- a/templates/actors/newActor/parts/swalt-inventory.html +++ b/templates/actors/newActor/parts/swalt-inventory.html @@ -63,9 +63,12 @@

    {{item.name~}} {{~#if item.isStack}} ({{item.data.quantity}}){{/if}} - {{~#if item.data.attuned}} {{/if}}

    + {{#if item.attunement}} +
    + +
    + {{/if}} {{#if ../../isCharacter}} diff --git a/templates/actors/newActor/parts/swalt-traits.html b/templates/actors/newActor/parts/swalt-traits.html index a78fe839..a1efa627 100644 --- a/templates/actors/newActor/parts/swalt-traits.html +++ b/templates/actors/newActor/parts/swalt-traits.html @@ -14,12 +14,12 @@ placeholder="0" class="value-number" /> diff --git a/templates/actors/oldActor/character-sheet.html b/templates/actors/oldActor/character-sheet.html index 05f14052..9bda3baa 100644 --- a/templates/actors/oldActor/character-sheet.html +++ b/templates/actors/oldActor/character-sheet.html @@ -135,10 +135,10 @@

    {{ability.label}}

    - {{numberFormat ability.mod decimals=0 sign=true}} + {{numberFormat ability.mod decimals=0 sign=true}} {{{ability.icon}}} - {{numberFormat ability.save decimals=0 sign=true}} + {{numberFormat ability.save decimals=0 sign=true}}
  • {{/each}} diff --git a/templates/actors/oldActor/npc-sheet.html b/templates/actors/oldActor/npc-sheet.html index 76001e43..7d99d4e5 100644 --- a/templates/actors/oldActor/npc-sheet.html +++ b/templates/actors/oldActor/npc-sheet.html @@ -98,10 +98,10 @@

    {{ability.label}}

    - {{numberFormat ability.mod decimals=0 sign=true}} + {{numberFormat ability.mod decimals=0 sign=true}} {{{ability.icon}}} - {{numberFormat ability.save decimals=0 sign=true}} + {{numberFormat ability.save decimals=0 sign=true}}
    {{/each}} diff --git a/templates/actors/oldActor/parts/actor-features.html b/templates/actors/oldActor/parts/actor-features.html index c2a0c27b..58796acf 100644 --- a/templates/actors/oldActor/parts/actor-features.html +++ b/templates/actors/oldActor/parts/actor-features.html @@ -101,7 +101,7 @@ {{item.data.archetype}}
    - Level {{item.data.levels}} + {{localize "SW5E.Level"}} {{item.data.levels}}
    {{/if}} @@ -128,8 +128,8 @@ {{/if}} - - + + {{/if}} diff --git a/templates/actors/oldActor/parts/actor-inventory.html b/templates/actors/oldActor/parts/actor-inventory.html index ddea2274..956bfdaa 100644 --- a/templates/actors/oldActor/parts/actor-inventory.html +++ b/templates/actors/oldActor/parts/actor-inventory.html @@ -59,11 +59,15 @@ {{else}}
    -

    - {{item.name~}} - {{~#if item.isStack}} ({{item.data.quantity}}){{/if}} - {{~#if item.data.attuned}} {{/if}} -

    +

    + {{item.name~}} + {{~#if item.isStack}} ({{item.data.quantity}}){{/if}} +

    + {{#if item.attunement}} +
    + +
    + {{/if}} {{/if}} diff --git a/templates/actors/oldActor/parts/actor-powerbook.html b/templates/actors/oldActor/parts/actor-powerbook.html index 7d645d0d..1498d7cd 100644 --- a/templates/actors/oldActor/parts/actor-powerbook.html +++ b/templates/actors/oldActor/parts/actor-powerbook.html @@ -95,8 +95,8 @@ {{#if section.canPrepare}} {{/if}} - - + + {{/if}} diff --git a/templates/actors/parts/active-effects.html b/templates/actors/parts/active-effects.html index f01d7416..26ce515a 100644 --- a/templates/actors/parts/active-effects.html +++ b/templates/actors/parts/active-effects.html @@ -2,8 +2,8 @@ {{#each effects as |section sid|}}
  • {{localize section.label}}

    -
    Source
    -
    Duration
    +
    {{localize "SW5E.Source"}}
    +
    {{localize "SW5E.Duration"}}
    {{localize "SW5E.Add"}} diff --git a/templates/apps/long-rest.html b/templates/apps/long-rest.html index 8717b9e7..302bc7f6 100644 --- a/templates/apps/long-rest.html +++ b/templates/apps/long-rest.html @@ -1,5 +1,5 @@
    -

    {{ localize "SW5E.LongRestHint" }}

    +

    {{ localize "SW5E.LongRestHint" }}

    {{#if promptNewDay}}
    diff --git a/templates/items/class.html b/templates/items/class.html index 7ea8225e..de0fe204 100644 --- a/templates/items/class.html +++ b/templates/items/class.html @@ -82,19 +82,44 @@
    + {{!-- Powercasting --}}
    - + {{selectOptions config.powerProgression selected=data.powercasting.progression localize=true}}
    +
    + +
    + +
    +
    + + {{!-- Proficiencies --}} +
    + + + + {{/if}} + +
    +
      + {{#each data.saves}} +
    • {{lookup ../config.abilities this}}
    • + {{/each}} +
    +
    +
    + {{!-- Level 1 skills --}}