Enhancements as per issue tracking sheet
This commit is contained in:
@@ -13,10 +13,8 @@ export default class OathHammerWeapon extends foundry.abstract.TypeDataModel {
|
||||
required: true, initial: "common", choices: SYSTEM.WEAPON_PROFICIENCY_GROUPS
|
||||
})
|
||||
|
||||
// Damage: melee = Might rank + damageMod dice; bows = baseDice (fixed, no Might)
|
||||
// usesMight=true → formula displayed as "M+2", "M-1", etc.
|
||||
// usesMight=false → formula displayed as e.g. "6" (fixed dice for bows)
|
||||
schema.usesMight = new fields.BooleanField({ required: true, initial: true })
|
||||
// Damage: melee/throwing = Might rank + damageMod dice; bows = baseDice (fixed, no Might)
|
||||
// usesMight is now derived from proficiencyGroup (see getter below)
|
||||
schema.damageMod = new fields.NumberField({ ...requiredInteger, initial: 0, min: -4, max: 16 })
|
||||
|
||||
// AP (Armor Penetration): penalty imposed on armor/defense rolls
|
||||
@@ -71,9 +69,16 @@ export default class OathHammerWeapon extends foundry.abstract.TypeDataModel {
|
||||
const map = { 0: "common", 1: "uncommon", 2: "rare", 3: "very-rare", 4: "legendary", 5: "legendary", 6: "legendary" }
|
||||
source.rarity = map[source.rarity] ?? "common"
|
||||
}
|
||||
// Remove legacy usesMight field — now derived from proficiencyGroup
|
||||
delete source.usesMight
|
||||
return super.migrateData(source)
|
||||
}
|
||||
|
||||
/** Derived: only bows skip Might for damage. Throwing weapons keep Might (arm strength). */
|
||||
get usesMight() {
|
||||
return this.proficiencyGroup !== "bows"
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable damage formula for display, e.g. "M+2", "M-1", "6"
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user