Add spells rolls and enhance CSS styling
- Add spell roll functionality to character sheets - Enhance CSS and LESS styling for better visual presentation - Update character templates and models - Remove old backup files (roll-old.mjs, roll.mjs.backup) - Improve character combat and equipment templates - Update utility functions and actor documents Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -159,38 +159,14 @@ export default class PrismRPGActor extends Actor {
|
||||
case "weapon-damage-medium":
|
||||
case "weapon-attack": {
|
||||
let weapon = this.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
||||
let skill
|
||||
let skills = this.items.filter((i) => i.type === "skill" && i.name.toLowerCase() === weapon.name.toLowerCase())
|
||||
if (skills.length > 0) {
|
||||
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
|
||||
} else {
|
||||
skills = this.items.filter((i) => i.type === "skill" && i.name.toLowerCase().replace(" skill", "") === weapon.name.toLowerCase())
|
||||
if (skills.length > 0) {
|
||||
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
|
||||
} else {
|
||||
skills = this.items.filter((i) => i.type === "skill" && i.system.weaponClass === weapon.system.weaponClass)
|
||||
if (skills.length > 0) {
|
||||
skill = this.getBestWeaponClassSkill(skills, rollType, 0.5)
|
||||
} else {
|
||||
skills = this.items.filter((i) => i.type === "skill" && i.system.weaponClass.includes(SYSTEM.WEAPON_CATEGORIES[weapon.system.weaponClass]))
|
||||
if (skills.length > 0) {
|
||||
skill = this.getBestWeaponClassSkill(skills, rollType, 0.25)
|
||||
} else {
|
||||
ui.notifications.warn(game.i18n.localize("PRISMRPG.Notifications.skillNotFound"))
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!weapon || !skill) {
|
||||
console.error("Weapon or skill not found", weapon, skill)
|
||||
if (!weapon) {
|
||||
console.error("Weapon not found", weapon, skill)
|
||||
ui.notifications.warn(game.i18n.localize("PRISMRPG.Notifications.skillNotFound"))
|
||||
return
|
||||
}
|
||||
|
||||
// Create a plain object for rollTarget to ensure weapon data is preserved
|
||||
rollTarget = {
|
||||
...skill.toObject(),
|
||||
weapon: weapon.toObject(),
|
||||
rollKey: rollKey,
|
||||
combat: foundry.utils.duplicate(this.system.combat),
|
||||
|
||||
Reference in New Issue
Block a user