75f79c1c08
- `magicOrder` ArrayField + ▲/▼ buttons for manual reordering
- Magic rolls use school's aspect for Wu Xing, not speciality's element
- Spell power: `difficulty × (aspectValue + freePowerLevels)` (not `successes × diff`)
- Prompt replaces `aspectspeciality`/`bonusmalusspeciality`/`heispend` with `freepowerlevels`
fix: code review issues
- combat.js: guard undefined `ids` in rollInitiative
- rolling.js: catch Dice So Nice promise, normalize French→English kungfu aspects
- weapon/armor/ingredient: `{ min: 0 }` on quantity
- character.js/npc.js: catch rollForActor fire-and-forget promises
- roll-actions.js/tinji-app.js: await ChatMessage.create
- sanhei.js: null guard on properties
- spell.js/kungfu.js: fix aspect name comments (French→English)
38 lines
1.6 KiB
JavaScript
38 lines
1.6 KiB
JavaScript
/**
|
||
* Chroniques de l'Étrange — Système FoundryVTT
|
||
*
|
||
* Chroniques de l'Étrange est un jeu de rôle édité par Antre-Monde Éditions.
|
||
* Ce système FoundryVTT est une implémentation indépendante et n'est pas
|
||
* affilié à Antre-Monde Éditions,
|
||
* mais a été réalisé avec l'autorisation d'Antre-Monde Éditions.
|
||
*
|
||
* @author LeRatierBretonnien
|
||
* @copyright 2024–2026 LeRatierBretonnien
|
||
* @license CC BY-NC-SA 4.0 – https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||
*/
|
||
|
||
export default class WeaponDataModel extends foundry.abstract.TypeDataModel {
|
||
static defineSchema() {
|
||
const { fields } = foundry.data
|
||
const stringField = (initial = "") => new fields.StringField({ required: true, nullable: false, initial })
|
||
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true })
|
||
const intField = (initial = 0, opts = {}) => new fields.NumberField({ required: true, nullable: false, integer: true, initial, ...opts })
|
||
const boolField = (initial = false) => new fields.BooleanField({ required: true, initial })
|
||
|
||
return {
|
||
reference: stringField(""),
|
||
description: htmlField(""),
|
||
hasSpeciality: boolField(false),
|
||
weaponType: stringField("melee"),
|
||
material: stringField(""),
|
||
damageAspect: stringField("metal"),
|
||
damageBase: intField(0),
|
||
range: stringField("contact"), // contact | courte | mediane | longue | extreme
|
||
obtainLevel: intField(0, { min: 0, max: 5 }),
|
||
obtainDifficulty: intField(0, { min: 0, max: 3 }),
|
||
quantity: intField(1, { min: 0 }),
|
||
notes: htmlField(""),
|
||
}
|
||
}
|
||
}
|