Compare commits
24 Commits
fvtt-les-h
...
6066091d8d
| Author | SHA1 | Date | |
|---|---|---|---|
| 6066091d8d | |||
| 287b6d83a7 | |||
| d8efba89a1 | |||
| 936d525503 | |||
| b113f630bf | |||
| 939cfb1e86 | |||
| 5f5e0e2a8c | |||
| c993a9a5b1 | |||
| cc7de0e53c | |||
| 4d41986c12 | |||
| d04731f475 | |||
| 44a641a0ca | |||
| 1ad022d193 | |||
| 1c7cf343b1 | |||
| d4b00e3508 | |||
| adc912e6cd | |||
| 51a457ebf6 | |||
| 2e9c558027 | |||
| bcd0758328 | |||
| 2b680a203f | |||
| e3d7874dce | |||
| ab6a5832c0 | |||
| d83a999974 | |||
| b83890a764 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
.history/
|
.history/
|
||||||
|
node_modules
|
||||||
|
|||||||
BIN
assets/icons/sort.webp
Normal file
BIN
assets/icons/sort.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
BIN
assets/scenes/8DjkNeeujp2qff1N-thumb.webp
Normal file
BIN
assets/scenes/8DjkNeeujp2qff1N-thumb.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
BIN
assets/scenes/ZjIQTg8S4hLZ4kXN-thumb.webp
Normal file
BIN
assets/scenes/ZjIQTg8S4hLZ4kXN-thumb.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
BIN
assets/scenes/aanMTXv8znDyE6qb-thumb.webp
Normal file
BIN
assets/scenes/aanMTXv8znDyE6qb-thumb.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
BIN
assets/scenes/ypDutqjqZcr7lx6I-thumb.webp
Normal file
BIN
assets/scenes/ypDutqjqZcr7lx6I-thumb.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
35
gulpfile.js
Normal file
35
gulpfile.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
const gulp = require('gulp');
|
||||||
|
const less = require('gulp-less');
|
||||||
|
const sourcemaps = require('gulp-sourcemaps');
|
||||||
|
|
||||||
|
// Paths
|
||||||
|
const paths = {
|
||||||
|
styles: {
|
||||||
|
src: 'less/**/*.less',
|
||||||
|
dest: 'styles/'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Compile LESS to CSS
|
||||||
|
function styles() {
|
||||||
|
return gulp.src('less/heritiers.less')
|
||||||
|
.pipe(sourcemaps.init())
|
||||||
|
.pipe(less())
|
||||||
|
.pipe(sourcemaps.write('.'))
|
||||||
|
.pipe(gulp.dest(paths.styles.dest));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch files
|
||||||
|
function watchFiles() {
|
||||||
|
gulp.watch(paths.styles.src, styles);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define complex tasks
|
||||||
|
const build = gulp.series(styles);
|
||||||
|
const watch = gulp.series(build, watchFiles);
|
||||||
|
|
||||||
|
// Export tasks
|
||||||
|
exports.styles = styles;
|
||||||
|
exports.build = build;
|
||||||
|
exports.watch = watch;
|
||||||
|
exports.default = build;
|
||||||
@@ -17,7 +17,8 @@
|
|||||||
"fee": "Fée",
|
"fee": "Fée",
|
||||||
"pouvoir": "Pouvoir",
|
"pouvoir": "Pouvoir",
|
||||||
"profil": "Profil",
|
"profil": "Profil",
|
||||||
"protection": "Protection"
|
"protection": "Protection",
|
||||||
|
"sort": "Sort"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
4
less/heritiers.less
Normal file
4
less/heritiers.less
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
// Main LESS file for Les Héritiers system
|
||||||
|
// Temporarily importing the full converted simple.css while we refactor
|
||||||
|
|
||||||
|
@import "simple-converted";
|
||||||
2809
less/simple-converted.less
Normal file
2809
less/simple-converted.less
Normal file
File diff suppressed because it is too large
Load Diff
213
modules/applications/heritiers-roll-dialog.mjs
Normal file
213
modules/applications/heritiers-roll-dialog.mjs
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
import { HeritiersUtility } from "../heritiers-utility.js"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dialogue de jet de dé pour Les Héritiers - Version AppV2
|
||||||
|
*/
|
||||||
|
export class HeritiersRollDialog {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create and display the roll dialog
|
||||||
|
* @param {HeritiersActor} actor - The actor making the roll
|
||||||
|
* @param {Object} rollData - Data for the roll
|
||||||
|
* @returns {Promise<Object>} - Returns a dialog-like object for compatibility
|
||||||
|
*/
|
||||||
|
static async create(actor, rollData) {
|
||||||
|
// Préparer le contexte pour le template
|
||||||
|
const context = {
|
||||||
|
...rollData,
|
||||||
|
img: actor.img,
|
||||||
|
name: actor.name,
|
||||||
|
config: game.system.lesheritiers.config,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rendre le template en HTML
|
||||||
|
const content = await foundry.applications.handlebars.renderTemplate(
|
||||||
|
"systems/fvtt-les-heritiers/templates/roll-dialog-generic.hbs",
|
||||||
|
context
|
||||||
|
)
|
||||||
|
|
||||||
|
// Préparer les boutons selon le mode et le niveau
|
||||||
|
const buttons = this._prepareButtons(rollData)
|
||||||
|
|
||||||
|
// Utiliser DialogV2.wait avec le HTML rendu
|
||||||
|
return foundry.applications.api.DialogV2.wait({
|
||||||
|
window: { title: "Test de Capacité", icon: "fa-solid fa-dice" },
|
||||||
|
classes: ["heritiers-roll-dialog"],
|
||||||
|
position: { width: 420 },
|
||||||
|
modal: false,
|
||||||
|
content,
|
||||||
|
buttons,
|
||||||
|
rejectClose: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Préparer les boutons selon le mode et le niveau de compétence
|
||||||
|
* @param {Object} rollData - Data for the roll
|
||||||
|
* @returns {Array} - Array of button configurations
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static _prepareButtons(rollData) {
|
||||||
|
const buttons = []
|
||||||
|
|
||||||
|
// Bouton d8 toujours disponible
|
||||||
|
buttons.push({
|
||||||
|
action: "rolld8",
|
||||||
|
label: "1d8",
|
||||||
|
icon: "fa-solid fa-dice-d8",
|
||||||
|
default: true,
|
||||||
|
callback: (event, button, dialog) => {
|
||||||
|
this._updateRollDataFromForm(rollData, button.form.elements)
|
||||||
|
this._executeRoll(rollData, "d8")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Bouton d10 si niveau > 0 ou pouvoir
|
||||||
|
const enableD10 = rollData.mode === "pouvoir" || rollData.competence?.system.niveau > 0
|
||||||
|
if (enableD10) {
|
||||||
|
buttons.push({
|
||||||
|
action: "rolld10",
|
||||||
|
label: "1d10",
|
||||||
|
icon: "fa-solid fa-dice-d10",
|
||||||
|
callback: (event, button, dialog) => {
|
||||||
|
this._updateRollDataFromForm(rollData, button.form.elements)
|
||||||
|
this._executeRoll(rollData, "d10")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bouton d12 si niveau > 1 ou pouvoir
|
||||||
|
const enableD12 = rollData.mode === "pouvoir" || rollData.competence?.system.niveau > 1
|
||||||
|
if (enableD12) {
|
||||||
|
buttons.push({
|
||||||
|
action: "rolld12",
|
||||||
|
label: "1d12",
|
||||||
|
icon: "fa-solid fa-dice-d12",
|
||||||
|
callback: (event, button, dialog) => {
|
||||||
|
this._updateRollDataFromForm(rollData, button.form.elements)
|
||||||
|
this._executeRoll(rollData, "d12")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bouton Tricherie si disponible
|
||||||
|
if (rollData.tricherie) {
|
||||||
|
buttons.push({
|
||||||
|
action: "rollTricherie",
|
||||||
|
label: "Lancer 1 Tricherie",
|
||||||
|
icon: "fa-solid fa-mask",
|
||||||
|
callback: (event, button, dialog) => {
|
||||||
|
this._updateRollDataFromForm(rollData, button.form.elements)
|
||||||
|
this._executeRoll(rollData, "tricherie")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bouton Héritage si disponible
|
||||||
|
if (rollData.heritage) {
|
||||||
|
buttons.push({
|
||||||
|
action: "rollHeritage",
|
||||||
|
label: "Lancer 1 Héritage",
|
||||||
|
icon: "fa-solid fa-crown",
|
||||||
|
callback: (event, button, dialog) => {
|
||||||
|
this._updateRollDataFromForm(rollData, button.form.elements)
|
||||||
|
this._executeRoll(rollData, "heritage")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si mode carac uniquement, on ne garde que d8
|
||||||
|
if (rollData.mode === "carac") {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
action: "rolld8",
|
||||||
|
label: "Lancer 1d8",
|
||||||
|
icon: "fa-solid fa-dice-d8",
|
||||||
|
default: true,
|
||||||
|
callback: (event, button, dialog) => {
|
||||||
|
this._updateRollDataFromForm(rollData, button.form.elements)
|
||||||
|
this._executeRoll(rollData, "d8")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
return buttons
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mettre à jour rollData avec les valeurs du formulaire
|
||||||
|
* @param {Object} rollData - L'objet rollData à mettre à jour
|
||||||
|
* @param {HTMLFormControlsCollection} formElements - Les éléments du formulaire
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static _updateRollDataFromForm(rollData, formElements) {
|
||||||
|
// Seuil de Difficulté
|
||||||
|
if (formElements.sdValue) {
|
||||||
|
rollData.sdValue = Number(formElements.sdValue.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Caractéristique
|
||||||
|
if (formElements.caracKey) {
|
||||||
|
rollData.caracKey = String(formElements.caracKey.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bonus/Malus contextuel
|
||||||
|
if (formElements['bonus-malus-context']) {
|
||||||
|
rollData.bonusMalusContext = Number(formElements['bonus-malus-context'].value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attaque à plusieurs
|
||||||
|
if (formElements['bonus-attaque-plusieurs']) {
|
||||||
|
rollData.bonusAttaquePlusieurs = Number(formElements['bonus-attaque-plusieurs'].value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spécialité
|
||||||
|
if (formElements.useSpecialite !== undefined) {
|
||||||
|
rollData.useSpecialite = formElements.useSpecialite.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
// Points d'usage du pouvoir
|
||||||
|
if (formElements.pouvoirPointsUsage) {
|
||||||
|
rollData.pouvoirPointsUsage = Number(formElements.pouvoirPointsUsage.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attaque dans le dos
|
||||||
|
if (formElements.attaqueDos !== undefined) {
|
||||||
|
rollData.attaqueDos = formElements.attaqueDos.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
// Seconde arme
|
||||||
|
if (formElements['bonus-attaque-seconde-arme']) {
|
||||||
|
rollData.secondeArme = String(formElements['bonus-attaque-seconde-arme'].value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attaque ciblée
|
||||||
|
if (formElements['attaque-cible']) {
|
||||||
|
rollData.attaqueCible = String(formElements['attaque-cible'].value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attaque à deux armes
|
||||||
|
if (formElements['bonus-attaque-deux-armes']) {
|
||||||
|
rollData.attaqueDeuxArmes = Number(formElements['bonus-attaque-deux-armes'].value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exécuter le jet de dés
|
||||||
|
* @param {Object} rollData - Data for the roll
|
||||||
|
* @param {String} dice - Type de dé (d8, d10, d12, tricherie, heritage)
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static _executeRoll(rollData, dice) {
|
||||||
|
if (dice === "heritage") {
|
||||||
|
rollData.useHeritage = true
|
||||||
|
} else if (dice === "tricherie") {
|
||||||
|
rollData.useTricherie = true
|
||||||
|
} else {
|
||||||
|
rollData.mainDice = dice
|
||||||
|
}
|
||||||
|
|
||||||
|
HeritiersUtility.rollHeritiers(rollData)
|
||||||
|
}
|
||||||
|
}
|
||||||
23
modules/applications/sheets/_module.mjs
Normal file
23
modules/applications/sheets/_module.mjs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Export all application sheets for Les Héritiers
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Actor Sheets
|
||||||
|
export { default as HeritiersPersonnageSheet } from './personnage-sheet.mjs';
|
||||||
|
export { default as HeritiersPnjSheet } from './pnj-sheet.mjs';
|
||||||
|
|
||||||
|
// Item Sheets
|
||||||
|
export { default as HeritiersAccessoireSheet } from './accessoire-sheet.mjs';
|
||||||
|
export { default as HeritiersArmeSheet } from './arme-sheet.mjs';
|
||||||
|
export { default as HeritiersAtoutFeeriqueSheet } from './atoutfeerique-sheet.mjs';
|
||||||
|
export { default as HeritiersAvantageSheet } from './avantage-sheet.mjs';
|
||||||
|
export { default as HeritiersCapaciteNaturelleSheet } from './capacitenaturelle-sheet.mjs';
|
||||||
|
export { default as HeritiersCompetenceSheet } from './competence-sheet.mjs';
|
||||||
|
export { default as HeritiersContactSheet } from './contact-sheet.mjs';
|
||||||
|
export { default as HeritiersDesavantageSheet } from './desavantage-sheet.mjs';
|
||||||
|
export { default as HeritiersEquipementSheet } from './equipement-sheet.mjs';
|
||||||
|
export { default as HeritiersFeeSheet } from './fee-sheet.mjs';
|
||||||
|
export { default as HeritiersPouvoirSheet } from './pouvoir-sheet.mjs';
|
||||||
|
export { default as HeritiersProfilSheet } from './profil-sheet.mjs';
|
||||||
|
export { default as HeritiersProtectionSheet } from './protection-sheet.mjs';
|
||||||
|
export { default as HeritiersSortSheet } from './sort-sheet.mjs';
|
||||||
19
modules/applications/sheets/accessoire-sheet.mjs
Normal file
19
modules/applications/sheets/accessoire-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersAccessoireSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.accessoire",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-accessoire-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/arme-sheet.mjs
Normal file
19
modules/applications/sheets/arme-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersArmeSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.arme",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-arme-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/atoutfeerique-sheet.mjs
Normal file
19
modules/applications/sheets/atoutfeerique-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersAtoutFeeriqueSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.atoutfeerique",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-atoutfeerique-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/avantage-sheet.mjs
Normal file
19
modules/applications/sheets/avantage-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersAvantageSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.avantage",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-avantage-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
675
modules/applications/sheets/base-actor-sheet.mjs
Normal file
675
modules/applications/sheets/base-actor-sheet.mjs
Normal file
@@ -0,0 +1,675 @@
|
|||||||
|
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||||
|
|
||||||
|
import { HeritiersUtility } from "../../heritiers-utility.js"
|
||||||
|
|
||||||
|
export default class HeritiersActorSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ActorSheetV2) {
|
||||||
|
/**
|
||||||
|
* Different sheet modes.
|
||||||
|
* @enum {number}
|
||||||
|
*/
|
||||||
|
static SHEET_MODES = { EDIT: 0, PLAY: 1 }
|
||||||
|
|
||||||
|
constructor(options = {}) {
|
||||||
|
super(options)
|
||||||
|
this.#dragDrop = this.#createDragDropHandlers()
|
||||||
|
this._sheetMode = this.constructor.SHEET_MODES.PLAY
|
||||||
|
}
|
||||||
|
|
||||||
|
#dragDrop
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
classes: ["fvtt-les-heritiers", "sheet", "actor"],
|
||||||
|
position: {
|
||||||
|
width: 780,
|
||||||
|
height: 840,
|
||||||
|
},
|
||||||
|
window: {
|
||||||
|
resizable: true,
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
submitOnChange: true,
|
||||||
|
closeOnSubmit: false,
|
||||||
|
},
|
||||||
|
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: "form" }],
|
||||||
|
actions: {
|
||||||
|
editImage: HeritiersActorSheet.#onEditImage,
|
||||||
|
toggleSheet: HeritiersActorSheet.#onToggleSheet,
|
||||||
|
editItem: HeritiersActorSheet.#onEditItem,
|
||||||
|
deleteItem: HeritiersActorSheet.#onDeleteItem,
|
||||||
|
createItem: HeritiersActorSheet.#onCreateItem,
|
||||||
|
equipItem: HeritiersActorSheet.#onEquipItem,
|
||||||
|
modifyQuantity: HeritiersActorSheet.#onModifyQuantity,
|
||||||
|
quantityIncrease: HeritiersActorSheet.#onQuantityIncrease,
|
||||||
|
quantityDecrease: HeritiersActorSheet.#onQuantityDecrease,
|
||||||
|
pvIncrease: HeritiersActorSheet.#onPvIncrease,
|
||||||
|
pvDecrease: HeritiersActorSheet.#onPvDecrease,
|
||||||
|
rollInitiative: HeritiersActorSheet.#onRollInitiative,
|
||||||
|
rollCarac: HeritiersActorSheet.#onRollCarac,
|
||||||
|
rollRang: HeritiersActorSheet.#onRollRang,
|
||||||
|
rollRootCompetence: HeritiersActorSheet.#onRollRootCompetence,
|
||||||
|
rollCompetence: HeritiersActorSheet.#onRollCompetence,
|
||||||
|
rollSort: HeritiersActorSheet.#onRollSort,
|
||||||
|
rollAttaqueArme: HeritiersActorSheet.#onRollAttaqueArme,
|
||||||
|
rollAttaqueBrutaleArme: HeritiersActorSheet.#onRollAttaqueBrutaleArme,
|
||||||
|
rollAttaqueChargeArme: HeritiersActorSheet.#onRollAttaqueChargeArme,
|
||||||
|
rollAssomerArme: HeritiersActorSheet.#onRollAssomerArme,
|
||||||
|
rollPouvoir: HeritiersActorSheet.#onRollPouvoir,
|
||||||
|
toggleMasque: HeritiersActorSheet.#onToggleMasque,
|
||||||
|
dialogRecupUsage: HeritiersActorSheet.#onDialogRecupUsage,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the sheet currently in 'Play' mode?
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
get isPlayMode() {
|
||||||
|
if (this._sheetMode === undefined) this._sheetMode = this.constructor.SHEET_MODES.PLAY
|
||||||
|
return this._sheetMode === this.constructor.SHEET_MODES.PLAY
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the sheet currently in 'Edit' mode?
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
get isEditMode() {
|
||||||
|
if (this._sheetMode === undefined) this._sheetMode = this.constructor.SHEET_MODES.PLAY
|
||||||
|
return this._sheetMode === this.constructor.SHEET_MODES.EDIT
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tab groups state
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
tabGroups = { primary: "competences" }
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const actor = this.document
|
||||||
|
|
||||||
|
const context = {
|
||||||
|
actor: actor,
|
||||||
|
system: actor.system,
|
||||||
|
source: actor.toObject(),
|
||||||
|
fields: actor.schema.fields,
|
||||||
|
systemFields: actor.system.schema.fields,
|
||||||
|
isEditable: this.isEditable,
|
||||||
|
isEditMode: this.isEditMode,
|
||||||
|
isPlayMode: this.isPlayMode,
|
||||||
|
isGM: game.user.isGM,
|
||||||
|
config: CONFIG.HERITIERS,
|
||||||
|
enrichedDescription: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.description || "", { async: true }),
|
||||||
|
enrichedHabitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.habitat || "", { async: true }),
|
||||||
|
enrichedRevesetranges: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.revesetranges || "", { async: true }),
|
||||||
|
enrichedSecretsdecouverts: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.secretsdecouverts || "", { async: true }),
|
||||||
|
enrichedQuestions: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.questions || "", { async: true }),
|
||||||
|
enrichedPlayernotes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(actor.system.biodata?.playernotes || "", { async: true }),
|
||||||
|
}
|
||||||
|
|
||||||
|
return context
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
_onRender(context, options) {
|
||||||
|
super._onRender(context, options)
|
||||||
|
|
||||||
|
// Activate drag & drop handlers
|
||||||
|
this.#dragDrop.forEach(d => d.bind(this.element))
|
||||||
|
|
||||||
|
// Manual tab navigation
|
||||||
|
const html = this.element
|
||||||
|
const tabLinks = html.querySelectorAll('.sheet-tabs a.item[data-tab]')
|
||||||
|
const tabContents = html.querySelectorAll('.sheet-body .tab[data-group="primary"]')
|
||||||
|
|
||||||
|
// Hide all tabs initially
|
||||||
|
tabContents.forEach(tab => {
|
||||||
|
tab.classList.remove('active')
|
||||||
|
tab.style.display = 'none'
|
||||||
|
})
|
||||||
|
|
||||||
|
// Show active tab
|
||||||
|
const activeTab = this.tabGroups.primary
|
||||||
|
const activeTabContent = html.querySelector(`.tab[data-group="primary"][data-tab="${activeTab}"]`)
|
||||||
|
if (activeTabContent) {
|
||||||
|
activeTabContent.classList.add('active')
|
||||||
|
activeTabContent.style.display = 'block'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Activate the corresponding nav link
|
||||||
|
tabLinks.forEach(link => {
|
||||||
|
if (link.dataset.tab === activeTab) {
|
||||||
|
link.classList.add('active')
|
||||||
|
} else {
|
||||||
|
link.classList.remove('active')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Tab click handler
|
||||||
|
tabLinks.forEach(link => {
|
||||||
|
link.addEventListener('click', (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
const tab = link.dataset.tab
|
||||||
|
|
||||||
|
// Update state
|
||||||
|
this.tabGroups.primary = tab
|
||||||
|
|
||||||
|
// Hide all tabs
|
||||||
|
tabContents.forEach(t => {
|
||||||
|
t.classList.remove('active')
|
||||||
|
t.style.display = 'none'
|
||||||
|
})
|
||||||
|
|
||||||
|
// Show selected tab
|
||||||
|
const selectedTab = html.querySelector(`.tab[data-group="primary"][data-tab="${tab}"]`)
|
||||||
|
if (selectedTab) {
|
||||||
|
selectedTab.classList.add('active')
|
||||||
|
selectedTab.style.display = 'block'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update nav links
|
||||||
|
tabLinks.forEach(l => {
|
||||||
|
if (l.dataset.tab === tab) {
|
||||||
|
l.classList.add('active')
|
||||||
|
} else {
|
||||||
|
l.classList.remove('active')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Inline item editing
|
||||||
|
html.querySelectorAll('.edit-item-data').forEach(input => {
|
||||||
|
input.addEventListener('change', (event) => {
|
||||||
|
const li = event.target.closest('.item')
|
||||||
|
const itemId = li?.dataset.itemId
|
||||||
|
const itemType = li?.dataset.itemType
|
||||||
|
const itemField = event.target.dataset.itemField
|
||||||
|
const dataType = event.target.dataset.dtype
|
||||||
|
const value = event.target.value
|
||||||
|
if (itemId && itemType && itemField) {
|
||||||
|
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// #region Drag & Drop
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create drag-and-drop workflow handlers for this Application
|
||||||
|
* @returns {DragDrop[]} An array of DragDrop handlers
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
#createDragDropHandlers() {
|
||||||
|
return this.options.dragDrop.map((d) => {
|
||||||
|
d.permissions = {
|
||||||
|
dragstart: this._canDragStart.bind(this),
|
||||||
|
drop: this._canDragDrop.bind(this),
|
||||||
|
}
|
||||||
|
d.callbacks = {
|
||||||
|
dragstart: this._onDragStart.bind(this),
|
||||||
|
drop: this._onDrop.bind(this),
|
||||||
|
}
|
||||||
|
return new foundry.applications.ux.DragDrop(d)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define whether a user is able to begin a dragstart workflow for a given drag selector
|
||||||
|
* @param {string} selector The candidate HTML selector for dragging
|
||||||
|
* @returns {boolean} Can the current user drag this selector?
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_canDragStart(selector) {
|
||||||
|
return this.isEditable
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define whether a user is able to conclude a drag-and-drop workflow for a given drop selector
|
||||||
|
* @param {string} selector The candidate HTML selector for the drop target
|
||||||
|
* @returns {boolean} Can the current user drop on this selector?
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_canDragDrop(selector) {
|
||||||
|
return this.isEditable
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback actions which occur at the beginning of a drag start workflow.
|
||||||
|
* @param {DragEvent} event The originating DragEvent
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_onDragStart(event) {
|
||||||
|
const li = event.currentTarget.closest(".item")
|
||||||
|
if (!li?.dataset.itemId) return
|
||||||
|
const item = this.actor.items.get(li.dataset.itemId)
|
||||||
|
if (!item) return
|
||||||
|
|
||||||
|
const dragData = item.toDragData()
|
||||||
|
event.dataTransfer.setData("text/plain", JSON.stringify(dragData))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback actions which occur when a dragged element is dropped on a target.
|
||||||
|
* @param {DragEvent} event The originating DragEvent
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
async _onDrop(event) {
|
||||||
|
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event)
|
||||||
|
const actor = this.actor
|
||||||
|
|
||||||
|
// Handle different data types
|
||||||
|
switch (data.type) {
|
||||||
|
case "Item":
|
||||||
|
return this._onDropItem(event, data)
|
||||||
|
case "Actor":
|
||||||
|
return this._onDropActor(event, data)
|
||||||
|
case "ActiveEffect":
|
||||||
|
return this._onDropActiveEffect(event, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle dropping an Item on the actor sheet
|
||||||
|
* @param {DragEvent} event
|
||||||
|
* @param {object} data
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
async _onDropItem(event, data) {
|
||||||
|
if (!this.actor.isOwner) return false
|
||||||
|
|
||||||
|
let item = await fromUuid(data.uuid)
|
||||||
|
if (item.pack) {
|
||||||
|
item = await HeritiersUtility.searchItem(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const itemData = item.toObject ? item.toObject() : item
|
||||||
|
return this.actor.createEmbeddedDocuments("Item", [itemData])
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle dropping an Actor on the sheet
|
||||||
|
* @param {DragEvent} event
|
||||||
|
* @param {object} data
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
async _onDropActor(event, data) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle dropping an ActiveEffect on the sheet
|
||||||
|
* @param {DragEvent} event
|
||||||
|
* @param {object} data
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
async _onDropActiveEffect(event, data) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
// #region Action Handlers
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle between edit and play mode
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static #onToggleSheet(event, target) {
|
||||||
|
const wasEditMode = this.isEditMode
|
||||||
|
this._sheetMode = wasEditMode ? this.constructor.SHEET_MODES.PLAY : this.constructor.SHEET_MODES.EDIT
|
||||||
|
this.render({ force: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit the actor image
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onEditImage(event, target) {
|
||||||
|
const fp = new FilePicker({
|
||||||
|
type: "image",
|
||||||
|
current: this.actor.img,
|
||||||
|
callback: (path) => {
|
||||||
|
this.actor.update({ img: path })
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return fp.browse()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit an item
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onEditItem(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const itemId = li?.dataset.itemId
|
||||||
|
if (!itemId) return
|
||||||
|
const item = this.actor.items.get(itemId)
|
||||||
|
if (item) item.sheet.render(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete an item
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onDeleteItem(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
await HeritiersUtility.confirmDelete(this, li)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new item
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onCreateItem(event, target) {
|
||||||
|
const itemType = target.dataset.type
|
||||||
|
|
||||||
|
// Cas spécial pour les sorts avec une compétence spécifique
|
||||||
|
if (itemType === "sort" && target.dataset.sortCompetence) {
|
||||||
|
const sortCompetence = target.dataset.sortCompetence
|
||||||
|
await this.actor.createEmbeddedDocuments('Item', [{
|
||||||
|
name: `Nouveau ${itemType} de ${sortCompetence}`,
|
||||||
|
type: itemType,
|
||||||
|
system: { competence: sortCompetence }
|
||||||
|
}], { renderSheet: true })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.actor.createEmbeddedDocuments("Item", [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equip/unequip an item
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onEquipItem(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const itemId = li?.dataset.itemId
|
||||||
|
if (itemId) {
|
||||||
|
await this.actor.equipItem(itemId)
|
||||||
|
this.render()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify item quantity
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onModifyQuantity(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const itemId = li?.dataset.itemId
|
||||||
|
const value = Number(target.dataset.quantiteValue)
|
||||||
|
if (itemId) {
|
||||||
|
await this.actor.incDecQuantity(itemId, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increase item quantity
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onQuantityIncrease(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const itemId = li?.dataset.itemId
|
||||||
|
if (itemId) {
|
||||||
|
await this.actor.incDecQuantity(itemId, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrease item quantity
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onQuantityDecrease(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const itemId = li?.dataset.itemId
|
||||||
|
if (itemId) {
|
||||||
|
await this.actor.incDecQuantity(itemId, -1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increase PV
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onPvIncrease(event, target) {
|
||||||
|
const currentPv = this.actor.system.pv.value || 0
|
||||||
|
const maxPv = this.actor.system.pv.max || 0
|
||||||
|
const newPv = Math.min(currentPv + 1, maxPv)
|
||||||
|
await this.actor.update({ 'system.pv.value': newPv })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrease PV
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onPvDecrease(event, target) {
|
||||||
|
const currentPv = this.actor.system.pv.value || 0
|
||||||
|
const newPv = Math.max(currentPv - 1, 0)
|
||||||
|
await this.actor.update({ 'system.pv.value': newPv })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll initiative
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollInitiative(event, target) {
|
||||||
|
await this.actor.rollInitiative()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll caractéristique
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollCarac(event, target) {
|
||||||
|
const key = target.dataset.key
|
||||||
|
if (key) {
|
||||||
|
await this.actor.rollCarac(key, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll rang
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollRang(event, target) {
|
||||||
|
const key = target.dataset.rangKey
|
||||||
|
if (key) {
|
||||||
|
await this.actor.rollRang(key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll root competence
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollRootCompetence(event, target) {
|
||||||
|
const compKey = target.dataset.attrKey
|
||||||
|
if (compKey) {
|
||||||
|
await this.actor.rollRootCompetence(compKey)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll competence
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollCompetence(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const compId = li?.dataset.itemId
|
||||||
|
if (compId) {
|
||||||
|
await this.actor.rollCompetence(compId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll sort
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollSort(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const sortId = li?.dataset.itemId
|
||||||
|
if (sortId) {
|
||||||
|
await this.actor.rollSort(sortId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll attaque arme
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollAttaqueArme(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const armeId = li?.dataset.itemId
|
||||||
|
if (armeId) {
|
||||||
|
await this.actor.rollAttaqueArme(armeId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll attaque brutale arme
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollAttaqueBrutaleArme(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const armeId = li?.dataset.itemId
|
||||||
|
if (armeId) {
|
||||||
|
await this.actor.rollAttaqueBrutaleArme(armeId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll attaque charge arme
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollAttaqueChargeArme(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const armeId = li?.dataset.itemId
|
||||||
|
if (armeId) {
|
||||||
|
await this.actor.rollAttaqueChargeArme(armeId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll assomer arme
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollAssomerArme(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const armeId = li?.dataset.itemId
|
||||||
|
if (armeId) {
|
||||||
|
await this.actor.rollAssomerArme(armeId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll pouvoir
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onRollPouvoir(event, target) {
|
||||||
|
const li = target.closest(".item")
|
||||||
|
const pouvoirId = li?.dataset.itemId
|
||||||
|
if (pouvoirId) {
|
||||||
|
await this.actor.rollPouvoir(pouvoirId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle masque
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onToggleMasque(event, target) {
|
||||||
|
await this.actor.toggleMasqueStatut()
|
||||||
|
this.render()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dialog récupération usage
|
||||||
|
* @param {Event} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onDialogRecupUsage(event, target) {
|
||||||
|
new Dialog({
|
||||||
|
title: "Récupération des Points d'Usage",
|
||||||
|
content: "<p>Combien de Points d'Usage souhaitez-vous récupérer ?</p>",
|
||||||
|
buttons: {
|
||||||
|
one: {
|
||||||
|
icon: '<i class="fas fa-check"></i>',
|
||||||
|
label: "1 Point",
|
||||||
|
callback: () => {
|
||||||
|
this.actor.recupUsage(1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
two: {
|
||||||
|
icon: '<i class="fas fa-check"></i>',
|
||||||
|
label: "2 Points",
|
||||||
|
callback: () => {
|
||||||
|
this.actor.recupUsage(2)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
three: {
|
||||||
|
icon: '<i class="fas fa-check"></i>',
|
||||||
|
label: "3 Points",
|
||||||
|
callback: () => {
|
||||||
|
this.actor.recupUsage(3)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancel: {
|
||||||
|
icon: '<i class="fas fa-times"></i>',
|
||||||
|
label: "Annuler"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
default: "one"
|
||||||
|
}).render(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
}
|
||||||
212
modules/applications/sheets/base-item-sheet.mjs
Normal file
212
modules/applications/sheets/base-item-sheet.mjs
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||||
|
|
||||||
|
export default class HeritiersItemSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
||||||
|
constructor(options = {}) {
|
||||||
|
super(options)
|
||||||
|
this.#dragDrop = this.#createDragDropHandlers()
|
||||||
|
}
|
||||||
|
|
||||||
|
#dragDrop
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
classes: ["fvtt-les-heritiers", "item"],
|
||||||
|
position: {
|
||||||
|
width: 620,
|
||||||
|
height: 600,
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
submitOnChange: true,
|
||||||
|
},
|
||||||
|
window: {
|
||||||
|
resizable: true,
|
||||||
|
},
|
||||||
|
tabs: [
|
||||||
|
{
|
||||||
|
navSelector: 'nav[data-group="primary"]',
|
||||||
|
contentSelector: "section.sheet-body",
|
||||||
|
initial: "description",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dragDrop: [{ dragSelector: "[data-drag]", dropSelector: null }],
|
||||||
|
actions: {
|
||||||
|
editImage: HeritiersItemSheet.#onEditImage,
|
||||||
|
postItem: HeritiersItemSheet.#onPostItem,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tab groups state
|
||||||
|
* @type {object}
|
||||||
|
*/
|
||||||
|
tabGroups = { primary: "description" }
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const context = {
|
||||||
|
fields: this.document.schema.fields,
|
||||||
|
systemFields: this.document.system.schema.fields,
|
||||||
|
item: this.document,
|
||||||
|
system: this.document.system,
|
||||||
|
source: this.document.toObject(),
|
||||||
|
enrichedDescription: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true }),
|
||||||
|
isEditMode: true,
|
||||||
|
isEditable: this.isEditable,
|
||||||
|
isGM: game.user.isGM,
|
||||||
|
config: CONFIG.HERITIERS,
|
||||||
|
}
|
||||||
|
return context
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
_onRender(context, options) {
|
||||||
|
super._onRender(context, options)
|
||||||
|
this.#dragDrop.forEach((d) => d.bind(this.element))
|
||||||
|
|
||||||
|
// Activate tab navigation manually
|
||||||
|
const nav = this.element.querySelector('nav.tabs[data-group]')
|
||||||
|
if (nav) {
|
||||||
|
const group = nav.dataset.group
|
||||||
|
// Activate the current tab
|
||||||
|
const activeTab = this.tabGroups[group] || "description"
|
||||||
|
nav.querySelectorAll('[data-tab]').forEach(link => {
|
||||||
|
const tab = link.dataset.tab
|
||||||
|
link.classList.toggle('active', tab === activeTab)
|
||||||
|
link.addEventListener('click', (event) => {
|
||||||
|
event.preventDefault()
|
||||||
|
this.tabGroups[group] = tab
|
||||||
|
this.render()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Show/hide tab content
|
||||||
|
this.element.querySelectorAll('[data-group="' + group + '"][data-tab]').forEach(content => {
|
||||||
|
content.classList.toggle('active', content.dataset.tab === activeTab)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// #region Drag-and-Drop Workflow
|
||||||
|
/**
|
||||||
|
* Create drag-and-drop workflow handlers for this Application
|
||||||
|
* @returns {DragDrop[]} An array of DragDrop handlers
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
#createDragDropHandlers() {
|
||||||
|
return this.options.dragDrop.map((d) => {
|
||||||
|
d.permissions = {
|
||||||
|
dragstart: this._canDragStart.bind(this),
|
||||||
|
drop: this._canDragDrop.bind(this),
|
||||||
|
}
|
||||||
|
d.callbacks = {
|
||||||
|
dragstart: this._onDragStart.bind(this),
|
||||||
|
dragover: this._onDragOver.bind(this),
|
||||||
|
drop: this._onDrop.bind(this),
|
||||||
|
}
|
||||||
|
return new foundry.applications.ux.DragDrop(d)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can the User start a drag workflow for a given drag selector?
|
||||||
|
* @param {string} selector The candidate HTML selector for the drag event
|
||||||
|
* @returns {boolean} Can the current user drag this selector?
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_canDragStart(selector) {
|
||||||
|
return this.isEditable
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can the User drop an entry at a given drop selector?
|
||||||
|
* @param {string} selector The candidate HTML selector for the drop event
|
||||||
|
* @returns {boolean} Can the current user drop on this selector?
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_canDragDrop(selector) {
|
||||||
|
return this.isEditable
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback for dragstart events.
|
||||||
|
* @param {DragEvent} event The drag start event
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_onDragStart(event) {
|
||||||
|
const target = event.currentTarget
|
||||||
|
const dragData = { type: "Item", uuid: this.document.uuid }
|
||||||
|
event.dataTransfer.setData("text/plain", JSON.stringify(dragData))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback for dragover events.
|
||||||
|
* @param {DragEvent} event The drag over event
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_onDragOver(event) {
|
||||||
|
// Default behavior is fine
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback for drop events.
|
||||||
|
* @param {DragEvent} event The drop event
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
async _onDrop(event) {
|
||||||
|
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event)
|
||||||
|
const item = await fromUuid(data.uuid)
|
||||||
|
if (!item) return
|
||||||
|
|
||||||
|
console.log("Item dropped:", item)
|
||||||
|
}
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
// #region Action Handlers
|
||||||
|
/**
|
||||||
|
* Edit the item image
|
||||||
|
* @param {Event} event The triggering event
|
||||||
|
* @param {HTMLElement} target The target element
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onEditImage(event, target) {
|
||||||
|
const fp = new FilePicker({
|
||||||
|
type: "image",
|
||||||
|
current: this.document.img,
|
||||||
|
callback: (path) => {
|
||||||
|
this.document.update({ img: path })
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return fp.browse()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Post item to chat
|
||||||
|
* @param {Event} event The triggering event
|
||||||
|
* @param {HTMLElement} target The target element
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
static async #onPostItem(event, target) {
|
||||||
|
let chatData = foundry.utils.duplicate(this.document)
|
||||||
|
if (this.document.actor) {
|
||||||
|
chatData.actor = { id: this.document.actor.id }
|
||||||
|
}
|
||||||
|
// Don't post any image for the item if the default image is used
|
||||||
|
if (chatData.img.includes("/blank.png") || chatData.img.includes("/mystery-man")) {
|
||||||
|
chatData.img = null
|
||||||
|
}
|
||||||
|
// JSON object for easy creation
|
||||||
|
chatData.jsondata = JSON.stringify({
|
||||||
|
compendium: "postedItem",
|
||||||
|
payload: chatData,
|
||||||
|
})
|
||||||
|
|
||||||
|
const html = await renderTemplate('systems/fvtt-les-heritiers/templates/post-item.html', chatData)
|
||||||
|
const chatOptions = {
|
||||||
|
user: game.user.id,
|
||||||
|
content: html,
|
||||||
|
}
|
||||||
|
ChatMessage.create(chatOptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
}
|
||||||
19
modules/applications/sheets/capacitenaturelle-sheet.mjs
Normal file
19
modules/applications/sheets/capacitenaturelle-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersCapaciteNaturelleSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.capacitenaturelle",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-capacitenaturelle-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
65
modules/applications/sheets/competence-sheet.mjs
Normal file
65
modules/applications/sheets/competence-sheet.mjs
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersCompetenceSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.competence",
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
addSpecialite: HeritiersCompetenceSheet.#onAddSpecialite,
|
||||||
|
deleteSpecialite: HeritiersCompetenceSheet.#onDeleteSpecialite,
|
||||||
|
editSpecialite: HeritiersCompetenceSheet.#onEditSpecialite,
|
||||||
|
editSpecialiteDescription: HeritiersCompetenceSheet.#onEditSpecialiteDescription,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-competence-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
/* Event Handlers */
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
|
static async #onAddSpecialite(event, target) {
|
||||||
|
let spec = foundry.utils.duplicate(this.item.system.specialites) || []
|
||||||
|
spec.push({ name: "Nouvelle Spécialité", id: foundry.utils.randomID(16), used: false })
|
||||||
|
await this.item.update({ 'system.specialites': spec })
|
||||||
|
}
|
||||||
|
|
||||||
|
static async #onDeleteSpecialite(event, target) {
|
||||||
|
const li = target.closest(".specialite-item")
|
||||||
|
let index = parseInt(li.dataset.specialiteIndex)
|
||||||
|
let spec = foundry.utils.duplicate(this.item.system.specialites) || []
|
||||||
|
spec.splice(index, 1)
|
||||||
|
await this.item.update({ 'system.specialites': spec })
|
||||||
|
}
|
||||||
|
|
||||||
|
static async #onEditSpecialite(event, target) {
|
||||||
|
const li = target.closest(".specialite-item")
|
||||||
|
let index = parseInt(li.dataset.specialiteIndex)
|
||||||
|
let spec = foundry.utils.duplicate(this.item.system.specialites) || []
|
||||||
|
if (spec[index]) {
|
||||||
|
spec[index].name = target.value
|
||||||
|
spec[index].id = spec[index].id || foundry.utils.randomID(16)
|
||||||
|
await this.item.update({ 'system.specialites': spec })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static async #onEditSpecialiteDescription(event, target) {
|
||||||
|
const li = target.closest(".specialite-item")
|
||||||
|
let index = parseInt(li.dataset.specialiteIndex)
|
||||||
|
let spec = foundry.utils.duplicate(this.item.system.specialites) || []
|
||||||
|
if (spec[index]) {
|
||||||
|
spec[index].description = target.value
|
||||||
|
spec[index].id = spec[index].id || foundry.utils.randomID(16)
|
||||||
|
await this.item.update({ 'system.specialites': spec })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/contact-sheet.mjs
Normal file
19
modules/applications/sheets/contact-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersContactSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.contact",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-contact-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/desavantage-sheet.mjs
Normal file
19
modules/applications/sheets/desavantage-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersDesavantageSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.desavantage",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-desavantage-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/equipement-sheet.mjs
Normal file
19
modules/applications/sheets/equipement-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersEquipementSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.equipement",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-equipement-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/fee-sheet.mjs
Normal file
19
modules/applications/sheets/fee-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersFeeSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.fee",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-fee-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
59
modules/applications/sheets/personnage-sheet.mjs
Normal file
59
modules/applications/sheets/personnage-sheet.mjs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import HeritiersActorSheet from "./base-actor-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersPersonnageSheet extends HeritiersActorSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
classes: [...super.DEFAULT_OPTIONS.classes],
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Actor.personnage",
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
...super.DEFAULT_OPTIONS.actions,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/actor-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
tabGroups = { primary: "competences" }
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const context = await super._prepareContext()
|
||||||
|
const actor = this.document
|
||||||
|
|
||||||
|
// Add personnage-specific data
|
||||||
|
context.skills = actor.getSkills()
|
||||||
|
context.utileSkillsMental = actor.organizeUtileSkills("mental")
|
||||||
|
context.utileSkillsPhysical = actor.organizeUtileSkills("physical")
|
||||||
|
context.competencesMagie = game.system.lesheritiers.config.competencesMagie || []
|
||||||
|
context.futileSkills = actor.organizeFutileSkills()
|
||||||
|
context.contacts = actor.organizeContacts()
|
||||||
|
context.armes = foundry.utils.duplicate(actor.getWeapons())
|
||||||
|
context.monnaies = foundry.utils.duplicate(actor.getMonnaies())
|
||||||
|
context.pouvoirs = foundry.utils.duplicate(actor.getPouvoirs())
|
||||||
|
context.fee = foundry.utils.duplicate(actor.getFee() || {})
|
||||||
|
context.protections = foundry.utils.duplicate(actor.getArmors())
|
||||||
|
context.combat = actor.getCombatValues()
|
||||||
|
context.equipements = foundry.utils.duplicate(actor.getEquipments())
|
||||||
|
context.avantages = foundry.utils.duplicate(actor.getAvantages())
|
||||||
|
context.atouts = foundry.utils.duplicate(actor.getAtouts())
|
||||||
|
context.capacites = foundry.utils.duplicate(actor.getCapacites())
|
||||||
|
context.desavantages = foundry.utils.duplicate(actor.getDesavantages())
|
||||||
|
context.profils = foundry.utils.duplicate(actor.getProfils())
|
||||||
|
context.pvMalus = actor.getPvMalus()
|
||||||
|
context.heritage = game.settings.get("fvtt-les-heritiers", "heritiers-heritage")
|
||||||
|
context.initiative = actor.getFlag("world", "last-initiative") || -1
|
||||||
|
context.magieList = actor.prepareMagie()
|
||||||
|
context.isPNJ = false
|
||||||
|
|
||||||
|
return context
|
||||||
|
}
|
||||||
|
}
|
||||||
59
modules/applications/sheets/pnj-sheet.mjs
Normal file
59
modules/applications/sheets/pnj-sheet.mjs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import HeritiersActorSheet from "./base-actor-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersPnjSheet extends HeritiersActorSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
classes: [...super.DEFAULT_OPTIONS.classes],
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Actor.pnj",
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
...super.DEFAULT_OPTIONS.actions,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/actor-pnj-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
tabGroups = { primary: "competences" }
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const context = await super._prepareContext()
|
||||||
|
const actor = this.document
|
||||||
|
|
||||||
|
// Add PNJ-specific data
|
||||||
|
context.skills = actor.getSkills()
|
||||||
|
context.utileSkillsMental = actor.organizeUtileSkills("mental")
|
||||||
|
context.utileSkillsPhysical = actor.organizeUtileSkills("physical")
|
||||||
|
context.competencesMagie = game.system.lesheritiers.config.competencesMagie || []
|
||||||
|
context.futileSkills = actor.organizeFutileSkills()
|
||||||
|
context.contacts = actor.organizeContacts()
|
||||||
|
context.armes = foundry.utils.duplicate(actor.getWeapons())
|
||||||
|
context.monnaies = foundry.utils.duplicate(actor.getMonnaies())
|
||||||
|
context.pouvoirs = foundry.utils.duplicate(actor.getPouvoirs())
|
||||||
|
context.fee = foundry.utils.duplicate(actor.getFee() || {})
|
||||||
|
context.protections = foundry.utils.duplicate(actor.getArmors())
|
||||||
|
context.combat = actor.getCombatValues()
|
||||||
|
context.equipements = foundry.utils.duplicate(actor.getEquipments())
|
||||||
|
context.avantages = foundry.utils.duplicate(actor.getAvantages())
|
||||||
|
context.atouts = foundry.utils.duplicate(actor.getAtouts())
|
||||||
|
context.capacites = foundry.utils.duplicate(actor.getCapacites())
|
||||||
|
context.desavantages = foundry.utils.duplicate(actor.getDesavantages())
|
||||||
|
context.profils = foundry.utils.duplicate(actor.getProfils())
|
||||||
|
context.pvMalus = actor.getPvMalus()
|
||||||
|
context.heritage = game.settings.get("fvtt-les-heritiers", "heritiers-heritage")
|
||||||
|
context.initiative = actor.getFlag("world", "last-initiative") || -1
|
||||||
|
context.magieList = actor.prepareMagie()
|
||||||
|
context.isPNJ = true
|
||||||
|
|
||||||
|
return context
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/pouvoir-sheet.mjs
Normal file
19
modules/applications/sheets/pouvoir-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersPouvoirSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.pouvoir",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-pouvoir-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/profil-sheet.mjs
Normal file
19
modules/applications/sheets/profil-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersProfilSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.profil",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-profil-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/applications/sheets/protection-sheet.mjs
Normal file
19
modules/applications/sheets/protection-sheet.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class HeritiersProtectionSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.protection",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-protection-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
27
modules/applications/sheets/sort-sheet.mjs
Normal file
27
modules/applications/sheets/sort-sheet.mjs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import HeritiersItemSheet from "./base-item-sheet.mjs"
|
||||||
|
import { HeritiersUtility } from "../../heritiers-utility.js"
|
||||||
|
|
||||||
|
export default class HeritiersSortSheet extends HeritiersItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
...super.DEFAULT_OPTIONS,
|
||||||
|
window: {
|
||||||
|
...super.DEFAULT_OPTIONS.window,
|
||||||
|
title: "SHEETS.Item.sort",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
sheet: {
|
||||||
|
template: "systems/fvtt-les-heritiers/templates/item-sort-sheet.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const context = await super._prepareContext()
|
||||||
|
context.competencesMagie = HeritiersUtility.getCompetencesMagie() || []
|
||||||
|
return context
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
import { HeritiersUtility } from "./heritiers-utility.js";
|
import { HeritiersUtility } from "./heritiers-utility.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class HeritiersActorSheet extends ActorSheet {
|
export class HeritiersActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
@@ -24,7 +24,7 @@ export class HeritiersActorSheet extends ActorSheet {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async getData() {
|
async getData() {
|
||||||
const objectData = foundry.utils.duplicate(this.object)
|
const objectData = foundry.utils.duplicate(this.object)
|
||||||
|
|
||||||
let formData = {
|
let formData = {
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@@ -38,31 +38,33 @@ export class HeritiersActorSheet extends ActorSheet {
|
|||||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||||
limited: this.object.limited,
|
limited: this.object.limited,
|
||||||
skills: this.actor.getSkills(),
|
skills: this.actor.getSkills(),
|
||||||
utileSkillsMental :this.actor.organizeUtileSkills("mental"),
|
utileSkillsMental: this.actor.organizeUtileSkills("mental"),
|
||||||
utileSkillsPhysical :this.actor.organizeUtileSkills("physical"),
|
utileSkillsPhysical: this.actor.organizeUtileSkills("physical"),
|
||||||
futileSkills :this.actor.organizeFutileSkills(),
|
competencesMagie: HeritiersUtility.getCompetencesMagie(),
|
||||||
|
futileSkills: this.actor.organizeFutileSkills(),
|
||||||
contacts: this.actor.organizeContacts(),
|
contacts: this.actor.organizeContacts(),
|
||||||
armes: foundry.utils.duplicate(this.actor.getWeapons()),
|
armes: foundry.utils.duplicate(this.actor.getWeapons()),
|
||||||
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
|
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
|
||||||
pouvoirs: foundry.utils.duplicate(this.actor.getPouvoirs()),
|
pouvoirs: foundry.utils.duplicate(this.actor.getPouvoirs()),
|
||||||
fee: foundry.utils.duplicate(this.actor.getFee() || {} ),
|
fee: foundry.utils.duplicate(this.actor.getFee() || {}),
|
||||||
protections: foundry.utils.duplicate(this.actor.getArmors()),
|
protections: foundry.utils.duplicate(this.actor.getArmors()),
|
||||||
combat: this.actor.getCombatValues(),
|
combat: this.actor.getCombatValues(),
|
||||||
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
|
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
|
||||||
avantages: foundry.utils.duplicate(this.actor.getAvantages()),
|
avantages: foundry.utils.duplicate(this.actor.getAvantages()),
|
||||||
atouts: foundry.utils.duplicate(this.actor.getAtouts()),
|
atouts: foundry.utils.duplicate(this.actor.getAtouts()),
|
||||||
capacites: foundry.utils.duplicate(this.actor.getCapacites()),
|
capacites: foundry.utils.duplicate(this.actor.getCapacites()),
|
||||||
desavantages: foundry.utils.duplicate(this.actor.getDesavantages()),
|
desavantages: foundry.utils.duplicate(this.actor.getDesavantages()),
|
||||||
profils: foundry.utils.duplicate(this.actor.getProfils()),
|
profils: foundry.utils.duplicate(this.actor.getProfils()),
|
||||||
pvMalus: this.actor.getPvMalus(),
|
pvMalus: this.actor.getPvMalus(),
|
||||||
heritage: game.settings.get("fvtt-les-heritiers", "heritiers-heritage"),
|
heritage: game.settings.get("fvtt-les-heritiers", "heritiers-heritage"),
|
||||||
initiative: this.actor.getFlag("world", "last-initiative") || -1,
|
initiative: this.actor.getFlag("world", "last-initiative") || -1,
|
||||||
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
|
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
|
||||||
revesetranges: await TextEditor.enrichHTML(this.object.system.biodata.revesetranges, {async: true}),
|
revesetranges: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.revesetranges, { async: true }),
|
||||||
secretsdecouverts: await TextEditor.enrichHTML(this.object.system.biodata.secretsdecouverts, {async: true}),
|
secretsdecouverts: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.secretsdecouverts, { async: true }),
|
||||||
questions: await TextEditor.enrichHTML(this.object.system.biodata.questions, {async: true}),
|
questions: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.questions, { async: true }),
|
||||||
habitat: await TextEditor.enrichHTML(this.object.system.biodata.habitat, {async: true}),
|
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
|
||||||
playernotes: await TextEditor.enrichHTML(this.object.system.biodata.playernotes, {async: true}),
|
playernotes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.playernotes, { async: true }),
|
||||||
|
magieList: this.actor.prepareMagie(),
|
||||||
options: this.options,
|
options: this.options,
|
||||||
owner: this.document.isOwner,
|
owner: this.document.isOwner,
|
||||||
editScore: this.options.editScore,
|
editScore: this.options.editScore,
|
||||||
@@ -120,14 +122,14 @@ export class HeritiersActorSheet extends ActorSheet {
|
|||||||
|
|
||||||
// Everything below here is only needed if the sheet is editable
|
// Everything below here is only needed if the sheet is editable
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
|
|
||||||
// Update Inventory Item
|
// Update Inventory Item
|
||||||
html.find('.item-edit').click(ev => {
|
html.find('.item-edit').click(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".item")
|
const li = $(ev.currentTarget).parents(".item")
|
||||||
let itemId = li.data("item-id")
|
let itemId = li.data("item-id")
|
||||||
const item = this.actor.items.get( itemId )
|
const item = this.actor.items.get(itemId)
|
||||||
item.sheet.render(true)
|
item.sheet.render(true)
|
||||||
})
|
})
|
||||||
// Delete Inventory Item
|
// Delete Inventory Item
|
||||||
html.find('.item-delete').click(ev => {
|
html.find('.item-delete').click(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".item");
|
const li = $(ev.currentTarget).parents(".item");
|
||||||
@@ -135,8 +137,8 @@ export class HeritiersActorSheet extends ActorSheet {
|
|||||||
})
|
})
|
||||||
html.find('.edit-item-data').change(ev => {
|
html.find('.edit-item-data').change(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".item")
|
const li = $(ev.currentTarget).parents(".item")
|
||||||
let itemId = li.data("item-id")
|
let itemId = li.data("item-id")
|
||||||
let itemType = li.data("item-type")
|
let itemType = li.data("item-type")
|
||||||
let itemField = $(ev.currentTarget).data("item-field")
|
let itemField = $(ev.currentTarget).data("item-field")
|
||||||
let dataType = $(ev.currentTarget).data("dtype")
|
let dataType = $(ev.currentTarget).data("dtype")
|
||||||
let value = ev.currentTarget.value
|
let value = ev.currentTarget.value
|
||||||
@@ -149,17 +151,31 @@ export class HeritiersActorSheet extends ActorSheet {
|
|||||||
let value = Number($(event.currentTarget).data("adversite-value"))
|
let value = Number($(event.currentTarget).data("adversite-value"))
|
||||||
this.actor.incDecAdversite(adv, value)
|
this.actor.incDecAdversite(adv, value)
|
||||||
})
|
})
|
||||||
|
|
||||||
html.find('.quantity-modify').click(event => {
|
html.find('.quantity-modify').click(event => {
|
||||||
const li = $(event.currentTarget).parents(".item")
|
const li = $(event.currentTarget).parents(".item")
|
||||||
const value = Number($(event.currentTarget).data("quantite-value"))
|
const value = Number($(event.currentTarget).data("quantite-value"))
|
||||||
this.actor.incDecQuantity( li.data("item-id"), value );
|
this.actor.incDecQuantity(li.data("item-id"), value);
|
||||||
|
})
|
||||||
|
|
||||||
|
html.find('[data-action="quantityIncrease"]').click(event => {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
const li = $(event.currentTarget).parents(".item")
|
||||||
|
this.actor.incDecQuantity(li.data("item-id"), 1);
|
||||||
|
})
|
||||||
|
|
||||||
|
html.find('[data-action="quantityDecrease"]').click(event => {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
const li = $(event.currentTarget).parents(".item")
|
||||||
|
this.actor.incDecQuantity(li.data("item-id"), -1);
|
||||||
})
|
})
|
||||||
|
|
||||||
html.find('.roll-initiative').click((event) => {
|
html.find('.roll-initiative').click((event) => {
|
||||||
this.actor.rollInitiative()
|
this.actor.rollInitiative()
|
||||||
})
|
})
|
||||||
|
|
||||||
html.find('.roll-carac').click((event) => {
|
html.find('.roll-carac').click((event) => {
|
||||||
const key = $(event.currentTarget).data("key")
|
const key = $(event.currentTarget).data("key")
|
||||||
this.actor.rollCarac(key, false)
|
this.actor.rollCarac(key, false)
|
||||||
@@ -167,37 +183,42 @@ export class HeritiersActorSheet extends ActorSheet {
|
|||||||
html.find('.roll-rang').click((event) => {
|
html.find('.roll-rang').click((event) => {
|
||||||
const key = $(event.currentTarget).data("rang-key")
|
const key = $(event.currentTarget).data("rang-key")
|
||||||
this.actor.rollRang(key, false)
|
this.actor.rollRang(key, false)
|
||||||
})
|
})
|
||||||
html.find('.roll-root-competence').click((event) => {
|
html.find('.roll-root-competence').click((event) => {
|
||||||
const compKey = $(event.currentTarget).data("attr-key")
|
const compKey = $(event.currentTarget).data("attr-key")
|
||||||
this.actor.rollRootCompetence(compKey)
|
this.actor.rollRootCompetence(compKey)
|
||||||
})
|
})
|
||||||
html.find('.roll-competence').click((event) => {
|
html.find('.roll-competence').click((event) => {
|
||||||
const li = $(event.currentTarget).parents(".item")
|
const li = $(event.currentTarget).parents(".item")
|
||||||
let compId = li.data("item-id")
|
let compId = li.data("item-id")
|
||||||
this.actor.rollCompetence(compId)
|
this.actor.rollCompetence(compId)
|
||||||
})
|
})
|
||||||
|
html.find('.roll-sort').click((event) => {
|
||||||
|
const li = $(event.currentTarget).parents(".item")
|
||||||
|
let sortId = li.data("item-id")
|
||||||
|
this.actor.rollSort(sortId)
|
||||||
|
})
|
||||||
html.find('.roll-attaque-arme').click((event) => {
|
html.find('.roll-attaque-arme').click((event) => {
|
||||||
const li = $(event.currentTarget).parents(".item")
|
const li = $(event.currentTarget).parents(".item")
|
||||||
let armeId = li.data("item-id")
|
let armeId = li.data("item-id")
|
||||||
this.actor.rollAttaqueArme(armeId)
|
this.actor.rollAttaqueArme(armeId)
|
||||||
})
|
})
|
||||||
html.find('.roll-attaque-brutale-arme').click((event) => {
|
html.find('.roll-attaque-brutale-arme').click((event) => {
|
||||||
const li = $(event.currentTarget).parents(".item")
|
const li = $(event.currentTarget).parents(".item")
|
||||||
let armeId = li.data("item-id")
|
let armeId = li.data("item-id")
|
||||||
this.actor.rollAttaqueBrutaleArme(armeId)
|
this.actor.rollAttaqueBrutaleArme(armeId)
|
||||||
})
|
})
|
||||||
html.find('.roll-attaque-charge-arme').click((event) => {
|
html.find('.roll-attaque-charge-arme').click((event) => {
|
||||||
const li = $(event.currentTarget).parents(".item")
|
const li = $(event.currentTarget).parents(".item")
|
||||||
let armeId = li.data("item-id")
|
let armeId = li.data("item-id")
|
||||||
this.actor.rollAttaqueChargeArme(armeId)
|
this.actor.rollAttaqueChargeArme(armeId)
|
||||||
})
|
})
|
||||||
html.find('.roll-assomer-arme').click((event) => {
|
html.find('.roll-assomer-arme').click((event) => {
|
||||||
const li = $(event.currentTarget).parents(".item")
|
const li = $(event.currentTarget).parents(".item")
|
||||||
let armeId = li.data("item-id")
|
let armeId = li.data("item-id")
|
||||||
this.actor.rollAssomerArme(armeId)
|
this.actor.rollAssomerArme(armeId)
|
||||||
})
|
})
|
||||||
|
|
||||||
html.find('.roll-pouvoir').click((event) => {
|
html.find('.roll-pouvoir').click((event) => {
|
||||||
const li = $(event.currentTarget).parents(".item")
|
const li = $(event.currentTarget).parents(".item")
|
||||||
let pouvoirId = li.data("item-id")
|
let pouvoirId = li.data("item-id")
|
||||||
@@ -209,21 +230,29 @@ export class HeritiersActorSheet extends ActorSheet {
|
|||||||
|
|
||||||
html.find('.item-add').click((event) => {
|
html.find('.item-add').click((event) => {
|
||||||
const itemType = $(event.currentTarget).data("type")
|
const itemType = $(event.currentTarget).data("type")
|
||||||
|
if (itemType == "sort") {
|
||||||
|
// Get data-sort-competence
|
||||||
|
let sortCompetence = $(event.currentTarget).data("sort-competence");
|
||||||
|
if (sortCompetence) {
|
||||||
|
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType} de ${sortCompetence}`, type: itemType, system: { competence: sortCompetence } }], { renderSheet: true })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
|
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
|
||||||
})
|
})
|
||||||
|
|
||||||
html.find('.lock-unlock-sheet').click((event) => {
|
html.find('.lock-unlock-sheet').click((event) => {
|
||||||
this.options.editScore = !this.options.editScore;
|
this.options.editScore = !this.options.editScore;
|
||||||
this.render(true);
|
this.render(true);
|
||||||
});
|
});
|
||||||
html.find('.item-equip').click(ev => {
|
html.find('.item-equip').click(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".item");
|
const li = $(ev.currentTarget).parents(".item");
|
||||||
this.actor.equipItem( li.data("item-id") );
|
this.actor.equipItem(li.data("item-id"));
|
||||||
this.render(true);
|
this.render(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/** @override */
|
/** @override */
|
||||||
setPosition(options = {}) {
|
setPosition(options = {}) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
import { HeritiersUtility } from "./heritiers-utility.js";
|
import { HeritiersUtility } from "./heritiers-utility.js";
|
||||||
import { HeritiersRollDialog } from "./heritiers-roll-dialog.js";
|
import { HeritiersRollDialog } from "./applications/heritiers-roll-dialog.mjs";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
|
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
|
||||||
@@ -17,8 +17,8 @@ export class HeritiersActor extends Actor {
|
|||||||
/**
|
/**
|
||||||
* Override the create() function to provide additional SoS functionality.
|
* Override the create() function to provide additional SoS functionality.
|
||||||
*
|
*
|
||||||
* This overrided create() function adds initial items
|
* This overrided create() function adds initial items
|
||||||
* Namely: Basic skills, money,
|
* Namely: Basic skills, money,
|
||||||
*
|
*
|
||||||
* @param {Object} data Barebones actor data which this function adds onto.
|
* @param {Object} data Barebones actor data which this function adds onto.
|
||||||
* @param {Object} options (Unused) Additional options which customize the creation workflow.
|
* @param {Object} options (Unused) Additional options which customize the creation workflow.
|
||||||
@@ -41,7 +41,7 @@ export class HeritiersActor extends Actor {
|
|||||||
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.competences")
|
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.competences")
|
||||||
data.items = []
|
data.items = []
|
||||||
for (let skill of skills) {
|
for (let skill of skills) {
|
||||||
if (skill.system.categorie == "utile") {
|
if (skill.system.categorie == "utile" && skill.system.profil != "magie") {
|
||||||
data.items.push(skill.toObject())
|
data.items.push(skill.toObject())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,6 +146,85 @@ export class HeritiersActor extends Actor {
|
|||||||
HeritiersUtility.sortArrayObjectsByName(pouvoirs)
|
HeritiersUtility.sortArrayObjectsByName(pouvoirs)
|
||||||
return pouvoirs
|
return pouvoirs
|
||||||
}
|
}
|
||||||
|
getSorts() {
|
||||||
|
return this.getItemSorted(["sort"])
|
||||||
|
}
|
||||||
|
getCompetencesMagie() {
|
||||||
|
let comp = []
|
||||||
|
for (let item of this.items) {
|
||||||
|
if (item.type == "competence" && item.system.profil == "magie") {
|
||||||
|
let itemObj = foundry.utils.duplicate(item)
|
||||||
|
comp.push(itemObj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HeritiersUtility.sortArrayObjectsByName(comp)
|
||||||
|
return comp
|
||||||
|
}
|
||||||
|
|
||||||
|
prepareMagie() {
|
||||||
|
let magieList = []
|
||||||
|
for (let item of this.items) {
|
||||||
|
if (item.type == "competence" && item.system.profil == "magie") {
|
||||||
|
let magie = {}
|
||||||
|
magie.name = item.name
|
||||||
|
magie.competence = foundry.utils.duplicate(item)
|
||||||
|
magie.rang = Math.round(item.system.niveau / 2);
|
||||||
|
magie.rangGenericName = game.system.lesheritiers.config.rangName[magie.rang];
|
||||||
|
console.log("Magie", item.name, item.system.niveau, magie.rang, magie.rangGenericName)
|
||||||
|
//magie.rangSpecificName = game.system.lesheritiers.config.rangNameSpecific[item.name][magie.rangGenericName];
|
||||||
|
magie.sorts = {}
|
||||||
|
if (item.name == "Magie du Clan") {
|
||||||
|
magie.sorts = {
|
||||||
|
"soufflecombat": {
|
||||||
|
1: { nomNiveau: magie.competence.system.nomniveausouffle.soufflecombat["1"], sorts: [] },
|
||||||
|
2: { nomNiveau: magie.competence.system.nomniveausouffle.soufflecombat["2"], sorts: [] },
|
||||||
|
3: { nomNiveau: magie.competence.system.nomniveausouffle.soufflecombat["3"], sorts: [] },
|
||||||
|
4: { nomNiveau: magie.competence.system.nomniveausouffle.soufflecombat["4"], sorts: [] }
|
||||||
|
},
|
||||||
|
"soufflemouvement": {
|
||||||
|
1: { nomNiveau: magie.competence.system.nomniveausouffle.soufflemouvement["1"], sorts: [] },
|
||||||
|
2: { nomNiveau: magie.competence.system.nomniveausouffle.soufflemouvement["2"], sorts: [] },
|
||||||
|
3: { nomNiveau: magie.competence.system.nomniveausouffle.soufflemouvement["3"], sorts: [] },
|
||||||
|
4: { nomNiveau: magie.competence.system.nomniveausouffle.soufflemouvement["4"], sorts: [] }
|
||||||
|
},
|
||||||
|
"souffleesprit": {
|
||||||
|
1: { nomNiveau: magie.competence.system.nomniveausouffle.souffleesprit["1"], sorts: [] },
|
||||||
|
2: { nomNiveau: magie.competence.system.nomniveausouffle.souffleesprit["2"], sorts: [] },
|
||||||
|
3: { nomNiveau: magie.competence.system.nomniveausouffle.souffleesprit["3"], sorts: [] },
|
||||||
|
4: { nomNiveau: magie.competence.system.nomniveausouffle.souffleesprit["4"], sorts: [] }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let sort of this.items) {
|
||||||
|
if (sort.type == "sort" && sort.system.competence == item.name) {
|
||||||
|
let sortObj = foundry.utils.duplicate(sort)
|
||||||
|
sortObj.sdValue = HeritiersUtility.getSDSortValue(Number(sort.system.niveau))
|
||||||
|
if (!magie.sorts[sort.system?.souffle]) {
|
||||||
|
console.warn("Sort with unknown souffle ", sort.system.souffle, sort)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
magie.sorts[sort.system.souffle][Number(sort.system.niveau)].sorts.push(sortObj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
magie.sorts = {
|
||||||
|
1: { nomNiveau: magie.competence.system.nomniveau["1"], sorts: [] },
|
||||||
|
2: { nomNiveau: magie.competence.system.nomniveau["2"], sorts: [] },
|
||||||
|
3: { nomNiveau: magie.competence.system.nomniveau["3"], sorts: [] },
|
||||||
|
4: { nomNiveau: magie.competence.system.nomniveau["4"], sorts: [] }
|
||||||
|
}
|
||||||
|
for (let sort of this.items) {
|
||||||
|
if (sort.type == "sort" && sort.system.competence == item.name) {
|
||||||
|
let sortObj = foundry.utils.duplicate(sort)
|
||||||
|
sortObj.sdValue = HeritiersUtility.getSDSortValue(Number(sort.system.niveau))
|
||||||
|
magie.sorts[Number(sort.system.niveau)].sorts.push(sortObj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
magieList.push(magie)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return magieList
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getSkills() {
|
getSkills() {
|
||||||
@@ -171,6 +250,28 @@ export class HeritiersActor extends Actor {
|
|||||||
item.specList = specList.toString()
|
item.specList = specList.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
organizeMagicSkills() {
|
||||||
|
let comp = {}
|
||||||
|
for (let key in game.system.lesheritiers.config.competenceProfil) {
|
||||||
|
if (game.system.lesheritiers.config.competenceProfil[key].kind == "magical")
|
||||||
|
comp[key] = { skills: [], niveau: 0 }
|
||||||
|
}
|
||||||
|
for (let item of this.items) {
|
||||||
|
if (item.type == "competence") {
|
||||||
|
if (item.system.categorie == "utile" && comp[item.system.profil]) {
|
||||||
|
this.prepareUtileSkill(item)
|
||||||
|
comp[item.system.profil].skills.push(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let key in comp) {
|
||||||
|
HeritiersUtility.sortArrayObjectsByName(comp[key].skills)
|
||||||
|
}
|
||||||
|
return Object.fromEntries(Object.entries(comp).sort())
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
organizeUtileSkills(kind = "mental") {
|
organizeUtileSkills(kind = "mental") {
|
||||||
let comp = {}
|
let comp = {}
|
||||||
@@ -192,6 +293,7 @@ export class HeritiersActor extends Actor {
|
|||||||
}
|
}
|
||||||
return Object.fromEntries(Object.entries(comp).sort())
|
return Object.fromEntries(Object.entries(comp).sort())
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
organizeContacts() {
|
organizeContacts() {
|
||||||
let contactList = {}
|
let contactList = {}
|
||||||
@@ -259,15 +361,37 @@ export class HeritiersActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async prepareData() {
|
async prepareData() {
|
||||||
super.prepareData();
|
super.prepareData();
|
||||||
|
}
|
||||||
|
|
||||||
let pvMax = (this.system.caracteristiques.con.rang * 3) + 9 + this.system.pv.mod
|
/* -------------------------------------------- */
|
||||||
if (this.system.pv.max != pvMax) {
|
getMaxRangMagie() {
|
||||||
this.update({ 'system.pv.max': pvMax })
|
let niv = 0
|
||||||
|
let bestMagie
|
||||||
|
for (let comp of this.items) {
|
||||||
|
if (comp.type == "competence" && comp.system.profil == "magie") {
|
||||||
|
if (comp.system.niveau > niv) {
|
||||||
|
bestMagie = comp
|
||||||
|
niv = comp.system.niveau
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (bestMagie) {
|
||||||
|
return Math.round(bestMagie.system.niveau / 2)
|
||||||
|
}
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
|
// Calculate derived PV max
|
||||||
|
let pvMax = (this.system.caracteristiques.con.rang * 3) + 9 + this.system.pv.mod
|
||||||
|
this.system.pv.max = pvMax
|
||||||
|
|
||||||
|
// Calculate derived Points d'Âme max
|
||||||
|
if (this.system.biodata.magie || this.type == "pnj") {
|
||||||
|
let pointsAmes = this.system.caracteristiques.esp.rang + this.system.caracteristiques.san.rang + this.getMaxRangMagie()
|
||||||
|
this.system.magie.pointsame.max = pointsAmes
|
||||||
|
}
|
||||||
|
|
||||||
if (this.type == 'personnage') {
|
if (this.type == 'personnage') {
|
||||||
}
|
}
|
||||||
@@ -397,6 +521,7 @@ export class HeritiersActor extends Actor {
|
|||||||
adversite[adv] = Math.max(adversite[adv], 0)
|
adversite[adv] = Math.max(adversite[adv], 0)
|
||||||
this.update({ 'system.adversite': adversite })
|
this.update({ 'system.adversite': adversite })
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async incDecQuantity(objetId, incDec = 0) {
|
async incDecQuantity(objetId, incDec = 0) {
|
||||||
let objetQ = this.items.get(objetId)
|
let objetQ = this.items.get(objetId)
|
||||||
@@ -585,8 +710,7 @@ export class HeritiersActor extends Actor {
|
|||||||
rollData.caracKey = "per"
|
rollData.caracKey = "per"
|
||||||
}
|
}
|
||||||
rollData.carac = this.system.caracteristiques[rollData.caracKey]
|
rollData.carac = this.system.caracteristiques[rollData.caracKey]
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -595,8 +719,7 @@ export class HeritiersActor extends Actor {
|
|||||||
rollData.mode = "carac"
|
rollData.mode = "carac"
|
||||||
rollData.carac = this.system.caracteristiques[key]
|
rollData.carac = this.system.caracteristiques[key]
|
||||||
rollData.caracKey = key
|
rollData.caracKey = key
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -605,8 +728,7 @@ export class HeritiersActor extends Actor {
|
|||||||
rollData.mode = "rang"
|
rollData.mode = "rang"
|
||||||
rollData.rang = this.system.rang[key]
|
rollData.rang = this.system.rang[key]
|
||||||
rollData.rangKey = key
|
rollData.rangKey = key
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollRootCompetence(compKey) {
|
async rollRootCompetence(compKey) {
|
||||||
@@ -614,8 +736,7 @@ export class HeritiersActor extends Actor {
|
|||||||
rollData.mode = "competence"
|
rollData.mode = "competence"
|
||||||
rollData.competence = { name: this.system.competences[compKey].label, system: { niveau: this.system.competences[compKey].niveau } }
|
rollData.competence = { name: this.system.competences[compKey].label, system: { niveau: this.system.competences[compKey].niveau } }
|
||||||
console.log("RollDatra", rollData)
|
console.log("RollDatra", rollData)
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -623,10 +744,82 @@ export class HeritiersActor extends Actor {
|
|||||||
let rollData = this.getCommonRollData(compId)
|
let rollData = this.getCommonRollData(compId)
|
||||||
rollData.mode = "competence"
|
rollData.mode = "competence"
|
||||||
console.log("RollDatra", rollData)
|
console.log("RollDatra", rollData)
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
inDecCarac(key, incDec) {
|
||||||
|
let carac = this.system.caracteristiques[key]
|
||||||
|
carac.value += incDec
|
||||||
|
if (carac.value < 0 || carac.value > carac.rang) {
|
||||||
|
ui.notifications.warn("Pas assez de points dans cette caractéristique ou rang max atteint !")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
carac.value = Math.max(carac.value, 0)
|
||||||
|
carac.value = Math.min(carac.value, carac.rang)
|
||||||
|
this.update({ [`system.caracteristiques.${key}`]: carac })
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async rollSort(sortId) {
|
||||||
|
let sort = this.items.get(sortId)
|
||||||
|
let comp = this.items.find(it => it.type == "competence" && it.name.toLowerCase() == sort.system.competence.toLowerCase())
|
||||||
|
if (!comp) {
|
||||||
|
ui.notifications.warn("Compétence de magie associée non trouvée !")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (sort.system.informatif) {
|
||||||
|
if (sort.system.texteinformatif) {
|
||||||
|
let chatData = { user: game.user.id, speaker: { actor: this, alias: this.name }, content: `<div class="heritiers-informatif-sort"><h4>Sort informatif !</h4>${sort.system.texteinformatif}</div>` }
|
||||||
|
ChatMessage.create(chatData)
|
||||||
|
} else {
|
||||||
|
ui.notifications.info("Ce sort est uniquement informatif et ne peut pas être lancé.")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let rollData = this.getCommonRollData(comp.id)
|
||||||
|
rollData.mode = "sort"
|
||||||
|
rollData.sort = foundry.utils.duplicate(sort)
|
||||||
|
rollData.sdValue = HeritiersUtility.getSDSortValue(Number(sort.system.niveau))
|
||||||
|
if (Number(sort.system.sdspecial) && Number(sort.system.sdspecial) > 0) {
|
||||||
|
rollData.sdValue = Number(sort.system.sdspecial)
|
||||||
|
}
|
||||||
|
rollData.sortPointsAme = Number(sort.system.niveau)
|
||||||
|
rollData.totalEsprit = 1
|
||||||
|
if (sort.system.competence == "Grand Langage") {
|
||||||
|
rollData.sortPointsAme *= 2
|
||||||
|
rollData.totalEsprit = Math.floor((rollData.sortPointsAme) / 3)
|
||||||
|
}
|
||||||
|
if (rollData.sortPointsAme > this.system.magie.pointsame.value) {
|
||||||
|
// Vérifier si au moins 1 point d'Esprit est disponible
|
||||||
|
if (this.system.caracteristiques.esp.value <= rollData.totalEsprit) {
|
||||||
|
ui.notifications.warn(`Pas assez de Points d'Esprit ni de Points d'Ame pour lancer ce sort (requis: ${rollData.totalEsprit}, disponible: ${this.system.caracteristiques.esp.value})`)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
rollData.spendEsprit = true
|
||||||
|
ui.notifications.warn(`Vous n'avez pas assez de Points d'Ame pour lancer ce sort (requis: ${rollData.sortPointsAme}, disponible: ${this.system.magie.pointsame.value}).`)
|
||||||
|
ui.notifications.warn(`${rollData.totalEsprit} Points d'Esprit seront utilisés à la place si vous effectuez le lancer.`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sort.system.carac2 != "none") {
|
||||||
|
// get the best carac between carac1 and carac2
|
||||||
|
if (this.system.caracteristiques[sort.system.carac1].value > this.system.caracteristiques[sort.system.carac2].value) {
|
||||||
|
rollData.caracKey = sort.system.carac1
|
||||||
|
} else {
|
||||||
|
rollData.caracKey = sort.system.carac2
|
||||||
|
}
|
||||||
|
rollData.caracMessage = "Ce sort peut être lancé avec " + game.system.lesheritiers.config.caracList[sort.system.carac1] + " ou " + game.system.lesheritiers.config.caracList[sort.system.carac2] + ". La meilleure caractéristique a été selectionnée."
|
||||||
|
} else {
|
||||||
|
rollData.caracKey = sort.system.carac1
|
||||||
|
}
|
||||||
|
console.log("RollData", rollData)
|
||||||
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollAttaqueArme(armeId) {
|
async rollAttaqueArme(armeId) {
|
||||||
let arme = this.items.get(armeId)
|
let arme = this.items.get(armeId)
|
||||||
@@ -644,13 +837,13 @@ export class HeritiersActor extends Actor {
|
|||||||
rollData.caracKey = key
|
rollData.caracKey = key
|
||||||
rollData.arme = arme
|
rollData.arme = arme
|
||||||
rollData.mode = "arme"
|
rollData.mode = "arme"
|
||||||
|
rollData.attackType = "Attaque normale"
|
||||||
rollData.armes = this.getOtherMeleeWeapons(arme)
|
rollData.armes = this.getOtherMeleeWeapons(arme)
|
||||||
if (rollData.defenderTokenId && arme.system.isMelee) {
|
if (rollData.defenderTokenId && arme.system.isMelee) {
|
||||||
rollData.cacheDifficulte = true
|
rollData.cacheDifficulte = true
|
||||||
}
|
}
|
||||||
console.log(">>>> ARME", rollData)
|
console.log(">>>> ARME", rollData)
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -666,10 +859,10 @@ export class HeritiersActor extends Actor {
|
|||||||
rollData.caracKey = key
|
rollData.caracKey = key
|
||||||
rollData.arme = foundry.utils.duplicate(arme)
|
rollData.arme = foundry.utils.duplicate(arme)
|
||||||
rollData.mode = "attaquebrutale"
|
rollData.mode = "attaquebrutale"
|
||||||
|
rollData.attackType = "Attaque brutale"
|
||||||
rollData.armes = this.getOtherMeleeWeapons(arme)
|
rollData.armes = this.getOtherMeleeWeapons(arme)
|
||||||
rollData.rulesMalus.push({ name: "Attaque brutale", value: -2 })
|
rollData.rulesMalus.push({ name: "Attaque brutale", value: -2 })
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -685,8 +878,8 @@ export class HeritiersActor extends Actor {
|
|||||||
rollData.arme = foundry.utils.duplicate(arme)
|
rollData.arme = foundry.utils.duplicate(arme)
|
||||||
rollData.armes = this.getOtherMeleeWeapons(arme)
|
rollData.armes = this.getOtherMeleeWeapons(arme)
|
||||||
rollData.mode = "attaquecharge"
|
rollData.mode = "attaquecharge"
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
rollData.attackType = "Attaque en charge"
|
||||||
rollDialog.render(true)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -701,11 +894,11 @@ export class HeritiersActor extends Actor {
|
|||||||
rollData.caracKey = "agi"
|
rollData.caracKey = "agi"
|
||||||
rollData.arme = foundry.utils.duplicate(arme)
|
rollData.arme = foundry.utils.duplicate(arme)
|
||||||
rollData.mode = "assommer"
|
rollData.mode = "assommer"
|
||||||
|
rollData.attackType = "Assommer"
|
||||||
if (rollData.defenderTokenId) {
|
if (rollData.defenderTokenId) {
|
||||||
rollData.cacheDifficulte = true
|
rollData.cacheDifficulte = true
|
||||||
}
|
}
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
rollDialog.render(true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -727,7 +920,7 @@ export class HeritiersActor extends Actor {
|
|||||||
callback: () => {
|
callback: () => {
|
||||||
rollData.pouvoirPointsUsage = 1;
|
rollData.pouvoirPointsUsage = 1;
|
||||||
HeritiersUtility.rollHeritiers(rollData);
|
HeritiersUtility.rollHeritiers(rollData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
two: {
|
two: {
|
||||||
icon: '<i class="fas fa-check"></i>',
|
icon: '<i class="fas fa-check"></i>',
|
||||||
@@ -735,7 +928,7 @@ export class HeritiersActor extends Actor {
|
|||||||
callback: () => {
|
callback: () => {
|
||||||
rollData.pouvoirPointsUsage = 2;
|
rollData.pouvoirPointsUsage = 2;
|
||||||
HeritiersUtility.rollHeritiers(rollData);
|
HeritiersUtility.rollHeritiers(rollData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
three: {
|
three: {
|
||||||
icon: '<i class="fas fa-check"></i>',
|
icon: '<i class="fas fa-check"></i>',
|
||||||
@@ -743,7 +936,7 @@ export class HeritiersActor extends Actor {
|
|||||||
callback: () => {
|
callback: () => {
|
||||||
rollData.pouvoirPointsUsage = 3;
|
rollData.pouvoirPointsUsage = 3;
|
||||||
HeritiersUtility.rollHeritiers(rollData);
|
HeritiersUtility.rollHeritiers(rollData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
four: {
|
four: {
|
||||||
icon: '<i class="fas fa-check"></i>',
|
icon: '<i class="fas fa-check"></i>',
|
||||||
@@ -751,13 +944,13 @@ export class HeritiersActor extends Actor {
|
|||||||
callback: () => {
|
callback: () => {
|
||||||
rollData.pouvoirPointsUsage = 4;
|
rollData.pouvoirPointsUsage = 4;
|
||||||
HeritiersUtility.rollHeritiers(rollData);
|
HeritiersUtility.rollHeritiers(rollData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
close: {
|
close: {
|
||||||
icon: '<i class="fas fa-times"></i>',
|
icon: '<i class="fas fa-times"></i>',
|
||||||
label: "Annuler",
|
label: "Annuler",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
default: "one",
|
default: "one",
|
||||||
@@ -766,7 +959,7 @@ export class HeritiersActor extends Actor {
|
|||||||
});
|
});
|
||||||
d.render(true);
|
d.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollPouvoir(pouvoirId) {
|
async rollPouvoir(pouvoirId) {
|
||||||
let pouvoir = this.items.get(pouvoirId)
|
let pouvoir = this.items.get(pouvoirId)
|
||||||
@@ -777,24 +970,49 @@ export class HeritiersActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let rollData = this.getCommonRollData(undefined, undefined)
|
let rollData = this.getCommonRollData(undefined, undefined)
|
||||||
if (pouvoir.system.feeriemasque != "autre") {
|
|
||||||
rollData.pouvoirBase = foundry.utils.duplicate(this.system.rang[pouvoir.system.feeriemasque.toLowerCase()])
|
|
||||||
rollData.pouvoirBase.label = "Féerie"
|
|
||||||
if (!pouvoir.system.carac) {
|
|
||||||
ui.notifications.warn("Le pouvoir actif " + pouvoir.name + " n'a pas de caractéristique associée")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
rollData.carac = foundry.utils.duplicate(this.system.caracteristiques[pouvoir.system.carac])
|
|
||||||
rollData.caracKey = pouvoir.system.carac
|
|
||||||
}
|
|
||||||
rollData.pouvoirMaxUsage = this.getPouvoirUsageMax(pouvoir)
|
rollData.pouvoirMaxUsage = this.getPouvoirUsageMax(pouvoir)
|
||||||
rollData.pouvoir = foundry.utils.duplicate(pouvoir)
|
rollData.pouvoir = foundry.utils.duplicate(pouvoir)
|
||||||
rollData.mode = "pouvoir"
|
rollData.mode = "pouvoir"
|
||||||
let rollDialog = await HeritiersRollDialog.create(this, rollData)
|
|
||||||
rollDialog.render(true)
|
if (pouvoir.system.feeriemasque != "autre") {
|
||||||
|
rollData.pouvoirBase = foundry.utils.duplicate(this.system.rang[pouvoir.system.feeriemasque.toLowerCase()])
|
||||||
|
rollData.pouvoirBase.label = "Féerie"
|
||||||
|
if (pouvoir.system.istest && !pouvoir.system.carac) {
|
||||||
|
ui.notifications.warn("Le pouvoir actif " + pouvoir.name + " n'a pas de caractéristique associée")
|
||||||
|
}
|
||||||
|
if (pouvoir.system.istest) {
|
||||||
|
rollData.carac = foundry.utils.duplicate(this.system.caracteristiques[pouvoir.system.carac])
|
||||||
|
rollData.caracKey = pouvoir.system.carac
|
||||||
|
} else {
|
||||||
|
rollData.noRoll = true
|
||||||
|
HeritiersUtility.rollHeritiers(rollData);
|
||||||
|
return;
|
||||||
|
//this.incDecPointsUsage(pouvoir.id, -rollData.pouvoirPointsUsage)
|
||||||
|
//ui.notifications.warn("Le pouvoir actif " + pouvoir.name + " a été utilisé, dépense de " + pouvoirPointsUsage + " points d'usage")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await HeritiersRollDialog.create(this, rollData)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
incDecPointsAme(value) {
|
||||||
|
let newValue = this.system.magie.pointsame.value + value
|
||||||
|
newValue = Math.max(newValue, 0)
|
||||||
|
newValue = Math.min(newValue, this.system.magie.pointsame.max)
|
||||||
|
this.update({ 'system.magie.pointsame.value': newValue })
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
incDecPV(value) {
|
||||||
|
let newValue = this.system.pv.value + value
|
||||||
|
newValue = Math.max(newValue, 0)
|
||||||
|
newValue = Math.min(newValue, this.system.pv.max)
|
||||||
|
this.update({ 'system.pv.value': newValue })
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
incDecPointsUsage(pouvoirId, value) {
|
incDecPointsUsage(pouvoirId, value) {
|
||||||
let pouvoir = this.items.get(pouvoirId)
|
let pouvoir = this.items.get(pouvoirId)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
import { HeritiersUtility } from "./heritiers-utility.js";
|
import { HeritiersUtility } from "./heritiers-utility.js";
|
||||||
import { HeritiersRollDialog } from "./heritiers-roll-dialog.js";
|
import { HeritiersRollDialog } from "./applications/heritiers-roll-dialog.mjs";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class HeritiersCommands {
|
export class HeritiersCommands {
|
||||||
|
|||||||
@@ -12,25 +12,26 @@ export const HERITIERS_CONFIG = {
|
|||||||
"san": "Sang-Froid"
|
"san": "Sang-Froid"
|
||||||
},
|
},
|
||||||
|
|
||||||
competenceCategorie : {
|
competenceCategorie: {
|
||||||
"utile": "Utile",
|
"utile": "Utile",
|
||||||
"futile": "Futile"
|
"futile": "Futile"
|
||||||
},
|
},
|
||||||
|
|
||||||
contactType: {
|
contactType: {
|
||||||
contact: "Contact",
|
contact: "Contact",
|
||||||
allie: "Allié",
|
allie: "Allié",
|
||||||
ennemi: "Ennemi",
|
ennemi: "Ennemi",
|
||||||
interet: "Personne d'interêt"
|
interet: "Personne d'interêt"
|
||||||
},
|
},
|
||||||
|
|
||||||
competenceProfil : {
|
competenceProfil: {
|
||||||
"aventurier": {kind: "physical", name: "Aventurier"},
|
"aventurier": { kind: "physical", name: "Aventurier" },
|
||||||
"roublard": {kind: "physical",name: "Roublard"},
|
"roublard": { kind: "physical", name: "Roublard" },
|
||||||
"combattant": {kind: "physical",name:"Combattant"},
|
"combattant": { kind: "physical", name: "Combattant" },
|
||||||
"erudit": {kind: "mental",name:"Erudit"},
|
"erudit": { kind: "mental", name: "Erudit" },
|
||||||
"savant": {kind: "mental",name:"Savant"},
|
"savant": { kind: "mental", name: "Savant" },
|
||||||
"gentleman": {kind: "mental",name:"Gentleman"}
|
"gentleman": { kind: "mental", name: "Gentleman" },
|
||||||
|
"magie": { kind: "magical", name: "Magie" },
|
||||||
},
|
},
|
||||||
baseTestPouvoir: {
|
baseTestPouvoir: {
|
||||||
"feerie": "Féerie",
|
"feerie": "Féerie",
|
||||||
@@ -52,7 +53,7 @@ export const HERITIERS_CONFIG = {
|
|||||||
},
|
},
|
||||||
statutMasque: {
|
statutMasque: {
|
||||||
"masque": "Masqué",
|
"masque": "Masqué",
|
||||||
"demasque":"Démasqué"
|
"demasque": "Démasqué"
|
||||||
},
|
},
|
||||||
niveauPouvoir: {
|
niveauPouvoir: {
|
||||||
"normal": "Normal",
|
"normal": "Normal",
|
||||||
@@ -65,32 +66,32 @@ export const HERITIERS_CONFIG = {
|
|||||||
},
|
},
|
||||||
seuilsDifficulte: {
|
seuilsDifficulte: {
|
||||||
"-1": "Aucun/Non applicable",
|
"-1": "Aucun/Non applicable",
|
||||||
"5": "Enfantine",
|
"5": "Enfantine (5)",
|
||||||
"6": "Triviale",
|
"6": "Triviale (6)",
|
||||||
"7": "Moins Triviale",
|
"7": "Moins Triviale (7)",
|
||||||
"8": "Aisée",
|
"8": "Aisée (8)",
|
||||||
"7": "Moins Aisée",
|
"9": "Moins Aisée (9)",
|
||||||
"10": "Normale",
|
"10": "Normale (10)",
|
||||||
"11": "Moins Normale",
|
"11": "Moins Normale (11)",
|
||||||
"12": "Compliquée",
|
"12": "Compliquée (12)",
|
||||||
"13": "Plus Compliquée",
|
"13": "Plus Compliquée (13)",
|
||||||
"14": "Difficile",
|
"14": "Difficile (14)",
|
||||||
"15": "Plus Difficile",
|
"15": "Plus Difficile (15)",
|
||||||
"16": "Très Difficile",
|
"16": "Très Difficile (16)",
|
||||||
"17": "Très Très Difficile",
|
"17": "Très Très Difficile (17)",
|
||||||
"18": "Critique",
|
"18": "Critique (18)",
|
||||||
"19": "Plus Critique",
|
"19": "Plus Critique (19)",
|
||||||
"20": "Insurmontable",
|
"20": "Insurmontable (20)",
|
||||||
"20": "Très Insurmontable",
|
"21": "Très Insurmontable (21)",
|
||||||
"22": "Surhumaine",
|
"22": "Surhumaine (22)",
|
||||||
"23": "Très Surhumaine",
|
"23": "Très Surhumaine (23)",
|
||||||
"24": "Epique",
|
"24": "Epique (24)",
|
||||||
"25": "Plus Epique",
|
"25": "Plus Epique (25)",
|
||||||
"26": "Légendaire",
|
"26": "Légendaire (26)",
|
||||||
"26": "Très Légendaire",
|
"27": "Très Légendaire (27)",
|
||||||
"28": "Mythique",
|
"28": "Mythique (28)",
|
||||||
"29": "Plus Mythique",
|
"29": "Plus Mythique (29)",
|
||||||
"30": "Divine"
|
"30": "Divine (30)"
|
||||||
},
|
},
|
||||||
|
|
||||||
attaqueCible: {
|
attaqueCible: {
|
||||||
@@ -99,8 +100,8 @@ export const HERITIERS_CONFIG = {
|
|||||||
"main": "Main",
|
"main": "Main",
|
||||||
"tete": "Tête/Coeur"
|
"tete": "Tête/Coeur"
|
||||||
},
|
},
|
||||||
|
|
||||||
categorieArme : {
|
categorieArme: {
|
||||||
"trait": "Arme de trait",
|
"trait": "Arme de trait",
|
||||||
"poing": "Arme de poing",
|
"poing": "Arme de poing",
|
||||||
"epaule": "Arme d'épaule",
|
"epaule": "Arme d'épaule",
|
||||||
@@ -108,7 +109,7 @@ export const HERITIERS_CONFIG = {
|
|||||||
"blanche": "Arme blanche",
|
"blanche": "Arme blanche",
|
||||||
"improvise": "Arme improvisée",
|
"improvise": "Arme improvisée",
|
||||||
"explosif": "Explosif"
|
"explosif": "Explosif"
|
||||||
},
|
},
|
||||||
typeArme: {
|
typeArme: {
|
||||||
"naturelle": "Arme naturelle",
|
"naturelle": "Arme naturelle",
|
||||||
"trait": "Trait",
|
"trait": "Trait",
|
||||||
@@ -130,13 +131,13 @@ export const HERITIERS_CONFIG = {
|
|||||||
"controlee": "Contrôlée (C)",
|
"controlee": "Contrôlée (C)",
|
||||||
"prohibee": "Prohibée (P)"
|
"prohibee": "Prohibée (P)"
|
||||||
},
|
},
|
||||||
armeDissimulation :{
|
armeDissimulation: {
|
||||||
"tresfacile": "Très facile (TF)",
|
"tresfacile": "Très facile (TF)",
|
||||||
"facile": "Facile (F)",
|
"facile": "Facile (F)",
|
||||||
"difficile": "Difficile (D)",
|
"difficile": "Difficile (D)",
|
||||||
"impossible": "Impossible (I)"
|
"impossible": "Impossible (I)"
|
||||||
},
|
},
|
||||||
typeProtection : {
|
typeProtection: {
|
||||||
"balle": "Protège ds balles",
|
"balle": "Protège ds balles",
|
||||||
"melee": "Protège en mélée",
|
"melee": "Protège en mélée",
|
||||||
"tout": "Tout type de dégats"
|
"tout": "Tout type de dégats"
|
||||||
@@ -145,7 +146,7 @@ export const HERITIERS_CONFIG = {
|
|||||||
"traditionnelle": "Traditionnelle",
|
"traditionnelle": "Traditionnelle",
|
||||||
"moderne": "Moderne",
|
"moderne": "Moderne",
|
||||||
"orientale": "Orientale"
|
"orientale": "Orientale"
|
||||||
},
|
},
|
||||||
typeContact: {
|
typeContact: {
|
||||||
"contact": "Contact",
|
"contact": "Contact",
|
||||||
"allie": "Allié",
|
"allie": "Allié",
|
||||||
@@ -163,37 +164,119 @@ export const HERITIERS_CONFIG = {
|
|||||||
"3": "3",
|
"3": "3",
|
||||||
"4": "4",
|
"4": "4",
|
||||||
},
|
},
|
||||||
attaquePlusieursList : {
|
attaquePlusieursList: {
|
||||||
"0": "0",
|
"0": "0",
|
||||||
"1": "+1",
|
"1": "+1",
|
||||||
"2": "+2",
|
"2": "+2",
|
||||||
},
|
},
|
||||||
attaque2ArmesListe: [
|
attaque2ArmesListe: [
|
||||||
{value: "0", label: "Aucun"},
|
{ value: "0", label: "Aucun" },
|
||||||
{value: "-4", label: "Deux armes à 1 main"},
|
{ value: "-4", label: "Deux armes à 1 main" },
|
||||||
{value: "-2", label: "Deux armes naturelles"},
|
{ value: "-2", label: "Deux armes naturelles" },
|
||||||
{value: "-2", label: "Avec spécialisation \"Mauvaise Main\""}
|
{ value: "-2", label: "Avec spécialisation \"Mauvaise Main\"" }
|
||||||
],
|
],
|
||||||
typeProfil: {
|
typeProfil: {
|
||||||
"mineur": "Mineur",
|
"mineur": "Mineur",
|
||||||
"majeur": "Majeur",
|
"majeur": "Majeur",
|
||||||
},
|
},
|
||||||
bonusMalusContext: [
|
bonusMalusContext: [
|
||||||
{value: "-6", label: "-6"},
|
{ value: "-6", label: "-6" },
|
||||||
{value: "-5", label: "-5"},
|
{ value: "-5", label: "-5" },
|
||||||
{value: "-4", label: "-4"},
|
{ value: "-4", label: "-4" },
|
||||||
{value: "-3", label: "-3"},
|
{ value: "-3", label: "-3" },
|
||||||
{value: "-2", label: "-2"},
|
{ value: "-2", label: "-2" },
|
||||||
{value: "-1", label: "-1"},
|
{ value: "-1", label: "-1" },
|
||||||
{value: "0", label: "0"},
|
{ value: "0", label: "0" },
|
||||||
{value: "1", label: "+1"},
|
{ value: "1", label: "+1" },
|
||||||
{value: "2", label: "+2"},
|
{ value: "2", label: "+2" },
|
||||||
{value: "3", label: "+3"},
|
{ value: "3", label: "+3" },
|
||||||
{value: "4", label: "+4"},
|
{ value: "4", label: "+4" },
|
||||||
{value: "5", label: "+5"},
|
{ value: "5", label: "+5" },
|
||||||
{value: "6", label: "+6"}
|
{ value: "6", label: "+6" }
|
||||||
],
|
],
|
||||||
listNiveau: []
|
listNiveauSort: {
|
||||||
|
"1": "1",
|
||||||
|
"2": "2",
|
||||||
|
"3": "3",
|
||||||
|
"4": "4"
|
||||||
|
},
|
||||||
|
listRangSort: {
|
||||||
|
"1": "1",
|
||||||
|
"2": "2",
|
||||||
|
"3": "3",
|
||||||
|
"4": "4",
|
||||||
|
"5": "5",
|
||||||
|
"6": "6",
|
||||||
|
"7": "7"
|
||||||
|
},
|
||||||
|
listNiveau: {
|
||||||
|
"0": "0",
|
||||||
|
"1": "1",
|
||||||
|
"2": "2",
|
||||||
|
"3": "3",
|
||||||
|
"4": "4",
|
||||||
|
"5": "5",
|
||||||
|
"6": "6",
|
||||||
|
"7": "7",
|
||||||
|
"8": "8",
|
||||||
|
"9": "9",
|
||||||
|
"10": "10"
|
||||||
|
},
|
||||||
|
rangName: [
|
||||||
|
"Novice",
|
||||||
|
"Novice",
|
||||||
|
"Adepte",
|
||||||
|
"Maître",
|
||||||
|
"Grand Maître"
|
||||||
|
],
|
||||||
|
rangNameSpecific: {
|
||||||
|
"Druidisme": {
|
||||||
|
"Novice": "Eubage",
|
||||||
|
"Adepte": "Saronide",
|
||||||
|
"Maître": "Ovate",
|
||||||
|
"Grand Maître": "Archidruide"
|
||||||
|
},
|
||||||
|
"Faëomancie": {
|
||||||
|
"Novice": "Marmiton",
|
||||||
|
"Adepte": "Queux",
|
||||||
|
"Maître": "Chef",
|
||||||
|
"Grand Maître": "Maître-queux"
|
||||||
|
},
|
||||||
|
"Nécromancie": {
|
||||||
|
"Novice": "Inexpertus",
|
||||||
|
"Adepte": "Discipulus",
|
||||||
|
"Maître": "Dominus",
|
||||||
|
"Grand Maître": "Magister"
|
||||||
|
},
|
||||||
|
"Necromancie": {
|
||||||
|
"Novice": "Inexpertus",
|
||||||
|
"Adepte": "Discipulus",
|
||||||
|
"Maître": "Dominus",
|
||||||
|
"Grand Maître": "Magister"
|
||||||
|
},
|
||||||
|
"Magie du Clan": {
|
||||||
|
"Novice": "Apprenti",
|
||||||
|
"Adepte": "Disciple",
|
||||||
|
"Maître": "Maître",
|
||||||
|
"Grand Maître": "Éminence"
|
||||||
|
},
|
||||||
|
"Théurgie": {
|
||||||
|
"Novice": "Frère",
|
||||||
|
"Adepte": "Père",
|
||||||
|
"Maître": "Saint",
|
||||||
|
"Grand Maître": "Apôtre"
|
||||||
|
},
|
||||||
|
"Grand Langage": {
|
||||||
|
"Novice": "Éveillé",
|
||||||
|
"Adepte": "Initié",
|
||||||
|
"Maître": "Sage",
|
||||||
|
"Grand Maître": "Docteur"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
soufflesMagieDuClan: {
|
||||||
|
"soufflecombat": "Souffle du Combat",
|
||||||
|
"soufflemouvement": "Souffle du Mouvement",
|
||||||
|
"souffleesprit": "Souffle de l'Esprit"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,18 +4,17 @@ import { HeritiersUtility } from "./heritiers-utility.js";
|
|||||||
* Extend the basic ItemSheet with some very simple modifications
|
* Extend the basic ItemSheet with some very simple modifications
|
||||||
* @extends {ItemSheet}
|
* @extends {ItemSheet}
|
||||||
*/
|
*/
|
||||||
export class HeritiersItemSheet extends ItemSheet {
|
export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
|
|
||||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||||
classes: ["fvtt-les-heritiers", "sheet", "item"],
|
classes: ["fvtt-les-heritiers", "sheet", "item"],
|
||||||
template: "systems/fvtt-les-heritiers/templates/item-sheet.html",
|
|
||||||
dragDrop: [{ dragSelector: null, dropSelector: null }],
|
dragDrop: [{ dragSelector: null, dropSelector: null }],
|
||||||
width: 620,
|
width: 620,
|
||||||
height: 550,
|
height: 550,
|
||||||
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
|
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,9 +60,9 @@ export class HeritiersItemSheet extends ItemSheet {
|
|||||||
limited: this.object.limited,
|
limited: this.object.limited,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
owner: this.document.isOwner,
|
owner: this.document.isOwner,
|
||||||
config: game.system.lesheritiers.config,
|
config: game.system.lesheritiers.config,
|
||||||
isArmeMelee: HeritiersUtility.isArmeMelee(this.object),
|
isArmeMelee: HeritiersUtility.isArmeMelee(this.object),
|
||||||
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
|
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, { async: true }),
|
||||||
mr: (this.object.type == 'specialisation'),
|
mr: (this.object.type == 'specialisation'),
|
||||||
isGM: game.user.isGM,
|
isGM: game.user.isGM,
|
||||||
usageMax: -1
|
usageMax: -1
|
||||||
@@ -76,6 +75,10 @@ export class HeritiersItemSheet extends ItemSheet {
|
|||||||
this.object.system.pointsusagecourant = formData.usageMax
|
this.object.system.pointsusagecourant = formData.usageMax
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.object.type == 'sort') {
|
||||||
|
formData.competencesMagie = HeritiersUtility.getCompetencesMagie()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//this.options.editable = !(this.object.origin == "embeddedItem");
|
//this.options.editable = !(this.object.origin == "embeddedItem");
|
||||||
console.log("ITEM DATA", formData, this);
|
console.log("ITEM DATA", formData, this);
|
||||||
@@ -138,45 +141,49 @@ export class HeritiersItemSheet extends ItemSheet {
|
|||||||
})
|
})
|
||||||
|
|
||||||
html.find('#add-specialite').click(ev => {
|
html.find('#add-specialite').click(ev => {
|
||||||
let spec = foundry.utils.duplicate(this.object.system.specialites)
|
let spec = foundry.utils.duplicate(this.item.system.specialites) || []
|
||||||
spec.push( { name: "Nouvelle Spécialité", id: foundry.utils.randomID(16), used: false })
|
spec.push({ name: "Nouvelle Spécialité", id: foundry.utils.randomID(16), used: false })
|
||||||
this.object.update( { 'system.specialites': spec })
|
this.item.update({ 'system.specialites': spec })
|
||||||
})
|
})
|
||||||
html.find('.delete-specialite').click(ev => {
|
html.find('.delete-specialite').click(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".specialite-item")
|
const li = $(ev.currentTarget).parents(".specialite-item")
|
||||||
let index = li.data("specialite-index")
|
let index = li.data("specialite-index")
|
||||||
let spec = foundry.utils.duplicate(this.object.system.specialites)
|
let spec = foundry.utils.duplicate(this.item.system.specialites) || []
|
||||||
spec.splice(index,1)
|
spec.splice(index, 1)
|
||||||
this.object.update( { 'system.specialites': spec })
|
this.item.update({ 'system.specialites': spec })
|
||||||
})
|
})
|
||||||
html.find('.edit-specialite').change(ev => {
|
html.find('.edit-specialite').change(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".specialite-item")
|
const li = $(ev.currentTarget).parents(".specialite-item")
|
||||||
let index = li.data("specialite-index")
|
let index = li.data("specialite-index")
|
||||||
let spec = foundry.utils.duplicate(this.object.system.specialites)
|
let spec = foundry.utils.duplicate(this.item.system.specialites) || []
|
||||||
spec[index].name = ev.currentTarget.value
|
if (spec[index]) {
|
||||||
spec[index].id = spec[index].id || foundry.utils.randomID(16)
|
spec[index].name = ev.currentTarget.value
|
||||||
this.object.update( { 'system.specialites': spec })
|
spec[index].id = spec[index].id || foundry.utils.randomID(16)
|
||||||
|
this.item.update({ 'system.specialites': spec })
|
||||||
|
}
|
||||||
})
|
})
|
||||||
html.find('.edit-specialite-description').change(ev => {
|
html.find('.edit-specialite-description').change(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".specialite-item")
|
const li = $(ev.currentTarget).parents(".specialite-item")
|
||||||
let index = li.data("specialite-index")
|
let index = li.data("specialite-index")
|
||||||
let spec = foundry.utils.duplicate(this.object.system.specialites)
|
let spec = foundry.utils.duplicate(this.item.system.specialites) || []
|
||||||
spec[index].description = ev.currentTarget.value
|
if (spec[index]) {
|
||||||
spec[index].id = spec[index].id || foundry.utils.randomID(16)
|
spec[index].description = ev.currentTarget.value
|
||||||
this.object.update( { 'system.specialites': spec })
|
spec[index].id = spec[index].id || foundry.utils.randomID(16)
|
||||||
})
|
this.item.update({ 'system.specialites': spec })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
html.find('#add-automation').click(ev => {
|
html.find('#add-automation').click(ev => {
|
||||||
let autom = foundry.utils.duplicate(this.object.system.automations)
|
let autom = foundry.utils.duplicate(this.object.system.automations)
|
||||||
autom.push( { eventtype: "on-drop", name: "Automatisation 1", competence: "", minLevel: 0, id: foundry.utils.randomID(16) })
|
autom.push({ eventtype: "on-drop", name: "Automatisation 1", competence: "", minLevel: 0, id: foundry.utils.randomID(16) })
|
||||||
this.object.update( { 'system.automations': autom })
|
this.object.update({ 'system.automations': autom })
|
||||||
})
|
})
|
||||||
html.find('.delete-automation').click(ev => {
|
html.find('.delete-automation').click(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".automation-item")
|
const li = $(ev.currentTarget).parents(".automation-item")
|
||||||
let index = li.data("automation-index")
|
let index = li.data("automation-index")
|
||||||
let autom = foundry.utils.duplicate(this.object.system.automations)
|
let autom = foundry.utils.duplicate(this.object.system.automations)
|
||||||
autom.splice(index,1)
|
autom.splice(index, 1)
|
||||||
this.object.update( { 'system.automations': autom })
|
this.object.update({ 'system.automations': autom })
|
||||||
})
|
})
|
||||||
html.find('.automation-edit-field').change(ev => {
|
html.find('.automation-edit-field').change(ev => {
|
||||||
let index = $(ev.currentTarget).data("automation-index")
|
let index = $(ev.currentTarget).data("automation-index")
|
||||||
@@ -184,9 +191,9 @@ export class HeritiersItemSheet extends ItemSheet {
|
|||||||
let auto = foundry.utils.duplicate(this.object.system.automations)
|
let auto = foundry.utils.duplicate(this.object.system.automations)
|
||||||
auto[index][field] = ev.currentTarget.value
|
auto[index][field] = ev.currentTarget.value
|
||||||
auto[index].id = auto[index].id || foundry.utils.randomID(16)
|
auto[index].id = auto[index].id || foundry.utils.randomID(16)
|
||||||
this.object.update( { 'system.automations': auto })
|
this.object.update({ 'system.automations': auto })
|
||||||
})
|
})
|
||||||
|
|
||||||
// Update Inventory Item
|
// Update Inventory Item
|
||||||
html.find('.item-delete').click(ev => {
|
html.find('.item-delete').click(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".item");
|
const li = $(ev.currentTarget).parents(".item");
|
||||||
@@ -199,7 +206,7 @@ export class HeritiersItemSheet extends ItemSheet {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
get template() {
|
get template() {
|
||||||
let type = this.item.type;
|
let type = this.item.type;
|
||||||
return `systems/fvtt-les-heritiers/templates/item-${type}-sheet.html`;
|
return `systems/fvtt-les-heritiers/templates/item-${type}-sheet.hbs`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export const defaultItemImg = {
|
|||||||
fee: "systems/fvtt-les-heritiers/assets/icons/faery_type.webp",
|
fee: "systems/fvtt-les-heritiers/assets/icons/faery_type.webp",
|
||||||
profil: "systems/fvtt-les-heritiers/assets/icons/profil.webp",
|
profil: "systems/fvtt-les-heritiers/assets/icons/profil.webp",
|
||||||
equipement: "systems/fvtt-les-heritiers/assets/icons/equipement.webp",
|
equipement: "systems/fvtt-les-heritiers/assets/icons/equipement.webp",
|
||||||
|
sort: "systems/fvtt-les-heritiers/assets/icons/sort.webp",
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,14 +9,17 @@
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// Import Modules
|
// Import Modules
|
||||||
import { HeritiersActor } from "./heritiers-actor.js";
|
import { HeritiersActor } from "./heritiers-actor.js";
|
||||||
import { HeritiersItemSheet } from "./heritiers-item-sheet.js";
|
import { HeritiersItem } from "./heritiers-item.js";
|
||||||
import { HeritiersActorSheet } from "./heritiers-actor-sheet.js";
|
|
||||||
import { HeritiersActorPNJSheet } from "./heritiers-actor-pnj-sheet.js";
|
|
||||||
import { HeritiersUtility } from "./heritiers-utility.js";
|
import { HeritiersUtility } from "./heritiers-utility.js";
|
||||||
import { HeritiersCombat } from "./heritiers-combat.js";
|
import { HeritiersCombat } from "./heritiers-combat.js";
|
||||||
import { HeritiersItem } from "./heritiers-item.js";
|
|
||||||
import { HERITIERS_CONFIG } from "./heritiers-config.js";
|
import { HERITIERS_CONFIG } from "./heritiers-config.js";
|
||||||
|
|
||||||
|
// Import DataModels
|
||||||
|
import * as models from "./models/index.mjs";
|
||||||
|
|
||||||
|
// Import AppV2 Sheets
|
||||||
|
import * as sheets from "./applications/sheets/_module.mjs";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* Foundry VTT Initialization */
|
/* Foundry VTT Initialization */
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -30,7 +33,7 @@ Hooks.once("init", async function () {
|
|||||||
HeritiersUtility.preloadHandlebarsTemplates()
|
HeritiersUtility.preloadHandlebarsTemplates()
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// Set an initiative formula for the system
|
// Set an initiative formula for the system
|
||||||
CONFIG.Combat.initiative = {
|
CONFIG.Combat.initiative = {
|
||||||
formula: "1d10",
|
formula: "1d10",
|
||||||
decimals: 1
|
decimals: 1
|
||||||
@@ -45,24 +48,62 @@ Hooks.once("init", async function () {
|
|||||||
// Define custom Entity classes
|
// Define custom Entity classes
|
||||||
CONFIG.Combat.documentClass = HeritiersCombat
|
CONFIG.Combat.documentClass = HeritiersCombat
|
||||||
CONFIG.Actor.documentClass = HeritiersActor
|
CONFIG.Actor.documentClass = HeritiersActor
|
||||||
|
CONFIG.Actor.dataModels = {
|
||||||
|
personnage: models.PersonnageDataModel,
|
||||||
|
pnj: models.PnjDataModel
|
||||||
|
}
|
||||||
|
|
||||||
CONFIG.Item.documentClass = HeritiersItem
|
CONFIG.Item.documentClass = HeritiersItem
|
||||||
// Create an array of values from 0 to 10
|
CONFIG.Item.dataModels = {
|
||||||
HERITIERS_CONFIG.listNiveau = Array.from({ length: 11 }, (v, k) => k)
|
accessoire: models.AccessoireDataModel,
|
||||||
|
arme: models.ArmeDataModel,
|
||||||
|
atoutfeerique: models.AtoutFeeriqueDataModel,
|
||||||
|
avantage: models.AvantageDataModel,
|
||||||
|
capacitenaturelle: models.CapaciteNaturelleDataModel,
|
||||||
|
competence: models.CompetenceDataModel,
|
||||||
|
contact: models.ContactDataModel,
|
||||||
|
desavantage: models.DesavantageDataModel,
|
||||||
|
equipement: models.EquipementDataModel,
|
||||||
|
fee: models.FeeDataModel,
|
||||||
|
pouvoir: models.PouvoirDataModel,
|
||||||
|
profil: models.ProfilDataModel,
|
||||||
|
protection: models.ProtectionDataModel,
|
||||||
|
sort: models.SortDataModel
|
||||||
|
}
|
||||||
|
|
||||||
// Create an object of bonus/malus from -6 to +6 signed
|
// Create an object of bonus/malus from -6 to +6 signed
|
||||||
HERITIERS_CONFIG.bonusMalus = Array.from({ length: 7 }, (v, k) => k - 6)
|
HERITIERS_CONFIG.bonusMalus = Array.from({ length: 7 }, (v, k) => toString(k - 6))
|
||||||
|
CONFIG.HERITIERS = HERITIERS_CONFIG
|
||||||
|
|
||||||
game.system.lesheritiers = {
|
game.system.lesheritiers = {
|
||||||
HeritiersUtility,
|
HeritiersUtility,
|
||||||
config: HERITIERS_CONFIG
|
config: HERITIERS_CONFIG,
|
||||||
|
models,
|
||||||
|
sheets
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// Register sheet application classes
|
// Register sheet application classes
|
||||||
Actors.unregisterSheet("core", ActorSheet);
|
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
|
||||||
Actors.registerSheet("fvtt-les-heritiers", HeritiersActorSheet, { types: ["personnage"], makeDefault: true })
|
foundry.documents.collections.Actors.registerSheet("fvtt-les-heritiers", sheets.HeritiersPersonnageSheet, { types: ["personnage"], makeDefault: true })
|
||||||
Actors.registerSheet("fvtt-les-heritiers", HeritiersActorPNJSheet, { types: ["pnj"], makeDefault: true })
|
foundry.documents.collections.Actors.registerSheet("fvtt-les-heritiers", sheets.HeritiersPnjSheet, { types: ["pnj"], makeDefault: true })
|
||||||
|
|
||||||
Items.unregisterSheet("core", ItemSheet);
|
// Register AppV2 Item Sheets
|
||||||
Items.registerSheet("fvtt-les-heritiers", HeritiersItemSheet, { makeDefault: true })
|
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersAccessoireSheet, { types: ["accessoire"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersArmeSheet, { types: ["arme"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersAtoutFeeriqueSheet, { types: ["atoutfeerique"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersAvantageSheet, { types: ["avantage"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersCapaciteNaturelleSheet, { types: ["capacitenaturelle"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersCompetenceSheet, { types: ["competence"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersContactSheet, { types: ["contact"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersDesavantageSheet, { types: ["desavantage"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersEquipementSheet, { types: ["equipement"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersFeeSheet, { types: ["fee"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersPouvoirSheet, { types: ["pouvoir"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersProfilSheet, { types: ["profil"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersProtectionSheet, { types: ["protection"], makeDefault: true })
|
||||||
|
foundry.documents.collections.Items.registerSheet("fvtt-les-heritiers", sheets.HeritiersSortSheet, { types: ["sort"], makeDefault: true })
|
||||||
|
|
||||||
HeritiersUtility.init()
|
HeritiersUtility.init()
|
||||||
|
|
||||||
@@ -73,12 +114,38 @@ function welcomeMessage() {
|
|||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
whisper: [game.user.id],
|
whisper: [game.user.id],
|
||||||
content: `<div id="welcome-message-heritiers"><span class="rdd-roll-part">
|
content: `
|
||||||
<strong>Bienvenue dans Les Heritiers et la Belle Epoque !</strong>
|
<div class="heritiers-chat-card heritiers-welcome-card">
|
||||||
<p>Les livres du JDR Les Heritiers sont nécessaires pour jouer : https://www.titam-france.fr</p>
|
<div class="chat-card-header welcome-header">
|
||||||
<p>Les Heritiers est jeu de rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.</p>
|
<div class="welcome-icon-wrapper">
|
||||||
<p>Système développé par LeRatierBretonnien, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
|
<i class="fas fa-book-open welcome-icon"></i>
|
||||||
` });
|
</div>
|
||||||
|
<div class="chat-actor-info">
|
||||||
|
<h3 class="chat-actor-name">Bienvenue dans Les Héritiers !</h3>
|
||||||
|
<div class="chat-action-name">et la Belle Époque</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="chat-card-content welcome-content">
|
||||||
|
<div class="welcome-section">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
<p>Les livres du JDR <strong>Les Héritiers</strong> sont nécessaires pour jouer.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="welcome-section">
|
||||||
|
<i class="fas fa-copyright"></i>
|
||||||
|
<p><em>Les Héritiers</em> est un jeu de rôle publié par <strong>Titam France / Sombres Projets</strong>. Tous les droits leur appartiennent.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="welcome-section">
|
||||||
|
<i class="fas fa-code"></i>
|
||||||
|
<p>Système développé par <strong>LeRatierBretonnien</strong></p>
|
||||||
|
<p>Support sur le <a href="https://discord.gg/pPSDNJk" target="_blank"><i class="fab fa-discord"></i> Discord FR de Foundry</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -108,13 +175,13 @@ Hooks.once("ready", function () {
|
|||||||
user: game.user._id
|
user: game.user._id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
import("https://www.uberwald.me/fvtt_appcount/count-class-ready.js").then(moduleCounter=>{
|
import("https://www.uberwald.me/fvtt_appcount/count-class-ready.js").then(moduleCounter => {
|
||||||
console.log("ClassCounter loaded", moduleCounter)
|
console.log("ClassCounter loaded", moduleCounter)
|
||||||
moduleCounter.ClassCounter.registerUsageCount()
|
moduleCounter.ClassCounter.registerUsageCount()
|
||||||
}).catch(err=>
|
}).catch(err =>
|
||||||
console.log("No stats available, giving up.")
|
console.log("No stats available, giving up.")
|
||||||
)
|
)
|
||||||
welcomeMessage();
|
welcomeMessage();
|
||||||
importDefaultScene();
|
importDefaultScene();
|
||||||
|
|
||||||
@@ -133,4 +200,3 @@ Hooks.on("chatMessage", (html, content, msg) => {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export class HeritiersRollDialog extends Dialog {
|
|||||||
static async create(actor, rollData) {
|
static async create(actor, rollData) {
|
||||||
|
|
||||||
let options = { classes: ["HeritiersDialog"], width: 420, height: 'fit-content', 'z-index': 99999 };
|
let options = { classes: ["HeritiersDialog"], width: 420, height: 'fit-content', 'z-index': 99999 };
|
||||||
let html = await renderTemplate('systems/fvtt-les-heritiers/templates/roll-dialog-generic.html', rollData);
|
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-les-heritiers/templates/roll-dialog-generic.html', rollData);
|
||||||
|
|
||||||
return new HeritiersRollDialog(actor, rollData, html, options);
|
return new HeritiersRollDialog(actor, rollData, html, options);
|
||||||
}
|
}
|
||||||
@@ -46,14 +46,14 @@ export class HeritiersRollDialog extends Dialog {
|
|||||||
if (rollData.tricherie) {
|
if (rollData.tricherie) {
|
||||||
buttons["rollTricherie"] = {
|
buttons["rollTricherie"] = {
|
||||||
icon: '<i class="fas fa-check"></i>',
|
icon: '<i class="fas fa-check"></i>',
|
||||||
label: "Lancer avec 1 Point de Tricherie",
|
label: "Avec 1 Tricherie",
|
||||||
callback: () => { this.roll("tricherie") }
|
callback: () => { this.roll("tricherie") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rollData.heritage) {
|
if (rollData.heritage) {
|
||||||
buttons["rollHeritage"] = {
|
buttons["rollHeritage"] = {
|
||||||
icon: '<i class="fas fa-check"></i>',
|
icon: '<i class="fas fa-check"></i>',
|
||||||
label: "Lancer avec 1 Point d'Héritage",
|
label: "Avec 1 Héritage",
|
||||||
callback: () => { this.roll("heritage") }
|
callback: () => { this.roll("heritage") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,6 @@ export class HeritiersRollDialog extends Dialog {
|
|||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
super.activateListeners(html);
|
super.activateListeners(html);
|
||||||
|
|
||||||
var dialog = this;
|
|
||||||
function onLoad() {
|
function onLoad() {
|
||||||
}
|
}
|
||||||
$(function () { onLoad(); });
|
$(function () { onLoad(); });
|
||||||
@@ -118,6 +117,7 @@ export class HeritiersRollDialog extends Dialog {
|
|||||||
this.rollData.sdValue = Number(event.currentTarget.value)
|
this.rollData.sdValue = Number(event.currentTarget.value)
|
||||||
})
|
})
|
||||||
html.find('#caracKey').change(async (event) => {
|
html.find('#caracKey').change(async (event) => {
|
||||||
|
//console.log("caracKey", event.currentTarget.value)
|
||||||
this.rollData.caracKey = String(event.currentTarget.value)
|
this.rollData.caracKey = String(event.currentTarget.value)
|
||||||
})
|
})
|
||||||
html.find('#bonus-malus-context').change((event) => {
|
html.find('#bonus-malus-context').change((event) => {
|
||||||
@@ -141,6 +141,6 @@ export class HeritiersRollDialog extends Dialog {
|
|||||||
html.find('#attaque-cible').change((event) => {
|
html.find('#attaque-cible').change((event) => {
|
||||||
this.rollData.attaqueCible = String(event.currentTarget.value)
|
this.rollData.attaqueCible = String(event.currentTarget.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ const __facesAdjacentes = {
|
|||||||
10: [8, 4, 3, 7]
|
10: [8, 4, 3, 7]
|
||||||
},
|
},
|
||||||
"d12": {
|
"d12": {
|
||||||
1:[2, 3, 4, 5, 6],
|
1: [2, 3, 4, 5, 6],
|
||||||
2: [1, 6, 8, 12, 3],
|
2: [1, 6, 8, 12, 3],
|
||||||
3: [1, 4, 11, 12, 2],
|
3: [1, 4, 11, 12, 2],
|
||||||
4: [1, 5, 10, 11, 3],
|
4: [1, 5, 10, 11, 3],
|
||||||
@@ -48,7 +48,7 @@ export class HeritiersUtility {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async init() {
|
static async init() {
|
||||||
Hooks.on('renderChatLog', (log, html, data) => HeritiersUtility.chatListeners(html))
|
Hooks.on('renderChatLog', (log, html, data) => HeritiersUtility.chatListeners(html))
|
||||||
Hooks.on("getChatLogEntryContext", (html, options) => HeritiersUtility.chatRollMenu(html, options))
|
/* Unused for Heitiers : Hooks.on("getChatMessageContextOptions", (html, options) => HeritiersUtility.chatRollMenu(html, options))*/
|
||||||
|
|
||||||
this.rollDataStore = {}
|
this.rollDataStore = {}
|
||||||
this.defenderStore = {}
|
this.defenderStore = {}
|
||||||
@@ -76,6 +76,10 @@ export class HeritiersUtility {
|
|||||||
Handlebars.registerHelper('mul', function (a, b) {
|
Handlebars.registerHelper('mul', function (a, b) {
|
||||||
return parseInt(a) * parseInt(b);
|
return parseInt(a) * parseInt(b);
|
||||||
})
|
})
|
||||||
|
Handlebars.registerHelper('and', function (...args) {
|
||||||
|
// Last argument is Handlebars options object, ignore it
|
||||||
|
return args.slice(0, -1).every(Boolean);
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +108,8 @@ export class HeritiersUtility {
|
|||||||
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.competences")
|
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.competences")
|
||||||
this.skills = skills.map(i => i.toObject())
|
this.skills = skills.map(i => i.toObject())
|
||||||
|
|
||||||
|
this.competencesMagie = this.skills.filter(s => s.system.profil == "magie")
|
||||||
|
|
||||||
game.settings.register("fvtt-les-heritiers", "heritiers-heritage", {
|
game.settings.register("fvtt-les-heritiers", "heritiers-heritage", {
|
||||||
name: "Points d'héritage",
|
name: "Points d'héritage",
|
||||||
hint: "Points d'héritage du groupe",
|
hint: "Points d'héritage du groupe",
|
||||||
@@ -114,6 +120,32 @@ export class HeritiersUtility {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static getSDSortValue(niveau) {
|
||||||
|
if (niveau <= 1) return 12;
|
||||||
|
if (niveau == 2) return 14;
|
||||||
|
if (niveau == 3) return 16;
|
||||||
|
if (niveau > 3) return 18;
|
||||||
|
return 18;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static getCompetencesMagie() {
|
||||||
|
return this.competencesMagie
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static buildCompetencesMagie() {
|
||||||
|
let competences = foundry.utils.duplicate(this.getCompetencesMagie())
|
||||||
|
for (let comp of competences) {
|
||||||
|
// Calcul du rang
|
||||||
|
let rang = Math.round(comp.system.niveau / 2);
|
||||||
|
competences.system.rang = rang;
|
||||||
|
competences.system.rangGenericName = game.system.lesheritiers.config.rangName[rang];
|
||||||
|
competences.system.rangSpecificName = game.system.lesheritiers.config.rangNameSpecific[comp.Name][competences.system.rangGenericName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async loadCompendiumData(compendium) {
|
static async loadCompendiumData(compendium) {
|
||||||
const pack = game.packs.get(compendium);
|
const pack = game.packs.get(compendium);
|
||||||
@@ -133,7 +165,7 @@ export class HeritiersUtility {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async chatListeners(html) {
|
static async chatListeners(html) {
|
||||||
|
|
||||||
html.on("click", '.predilection-reroll', async event => {
|
$(html).on("click", '.predilection-reroll', async event => {
|
||||||
let predIdx = $(event.currentTarget).data("predilection-index")
|
let predIdx = $(event.currentTarget).data("predilection-index")
|
||||||
let messageId = HeritiersUtility.findChatMessageId(event.currentTarget)
|
let messageId = HeritiersUtility.findChatMessageId(event.currentTarget)
|
||||||
let message = game.messages.get(messageId)
|
let message = game.messages.get(messageId)
|
||||||
@@ -143,19 +175,19 @@ export class HeritiersUtility {
|
|||||||
rollData.competence = foundry.utils.duplicate(actor.getCompetence(rollData.competence._id))
|
rollData.competence = foundry.utils.duplicate(actor.getCompetence(rollData.competence._id))
|
||||||
HeritiersUtility.rollHeritiers(rollData)
|
HeritiersUtility.rollHeritiers(rollData)
|
||||||
})
|
})
|
||||||
|
|
||||||
html.on("click", '.roll-tricherie-2', async event => {
|
$(html).on("click", '.roll-tricherie-2', async event => {
|
||||||
let messageId = HeritiersUtility.findChatMessageId(event.currentTarget)
|
let messageId = HeritiersUtility.findChatMessageId(event.currentTarget)
|
||||||
let message = game.messages.get(messageId)
|
let message = game.messages.get(messageId)
|
||||||
let rollData = message.getFlag("world", "heritiers-roll")
|
let rollData = message.getFlag("world", "heritiers-roll")
|
||||||
let actor = this.getActorFromRollData(rollData)
|
let actor = this.getActorFromRollData(rollData)
|
||||||
if ( await actor.incDecTricherie(-2) ) {
|
if (await actor.incDecTricherie(-2)) {
|
||||||
rollData.forcedValue = Number($(event.currentTarget).data("dice-value"))
|
rollData.forcedValue = Number($(event.currentTarget).data("dice-value"))
|
||||||
HeritiersUtility.rollHeritiers(rollData)
|
HeritiersUtility.rollHeritiers(rollData)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
html.on("click", '.roll-chat-degat', async event => {
|
$(html).on("click", '.roll-chat-degat', async event => {
|
||||||
let messageId = HeritiersUtility.findChatMessageId(event.currentTarget)
|
let messageId = HeritiersUtility.findChatMessageId(event.currentTarget)
|
||||||
let message = game.messages.get(messageId)
|
let message = game.messages.get(messageId)
|
||||||
let rollData = message.getFlag("world", "heritiers-roll")
|
let rollData = message.getFlag("world", "heritiers-roll")
|
||||||
@@ -169,13 +201,13 @@ export class HeritiersUtility {
|
|||||||
|
|
||||||
const templatePaths = [
|
const templatePaths = [
|
||||||
'systems/fvtt-les-heritiers/templates/editor-notes-gm.html',
|
'systems/fvtt-les-heritiers/templates/editor-notes-gm.html',
|
||||||
'systems/fvtt-les-heritiers/templates/partial-item-header.html',
|
'systems/fvtt-les-heritiers/templates/partial-item-header.hbs',
|
||||||
'systems/fvtt-les-heritiers/templates/partial-item-description.html',
|
'systems/fvtt-les-heritiers/templates/partial-item-description.hbs',
|
||||||
'systems/fvtt-les-heritiers/templates/partial-item-nav.html',
|
'systems/fvtt-les-heritiers/templates/partial-item-nav.hbs',
|
||||||
'systems/fvtt-les-heritiers/templates/partial-utile-skills.html',
|
'systems/fvtt-les-heritiers/templates/partial-utile-skills.hbs',
|
||||||
'systems/fvtt-les-heritiers/templates/partial-list-niveau.html'
|
'systems/fvtt-les-heritiers/templates/partial-actor-equipment.hbs'
|
||||||
]
|
]
|
||||||
return loadTemplates(templatePaths);
|
return foundry.applications.handlebars.loadTemplates(templatePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -259,7 +291,7 @@ export class HeritiersUtility {
|
|||||||
static saveRollData(rollData) {
|
static saveRollData(rollData) {
|
||||||
game.socket.emit("system.fvtt-les-heritiers", {
|
game.socket.emit("system.fvtt-les-heritiers", {
|
||||||
name: "msg_update_roll", data: rollData
|
name: "msg_update_roll", data: rollData
|
||||||
}); // Notify all other clients of the roll
|
}); // Notify all other clients of the roll
|
||||||
this.updateRollData(rollData);
|
this.updateRollData(rollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +422,7 @@ export class HeritiersUtility {
|
|||||||
rollData.finalResult -= 5 + rollValue // Remove also the dice result has it has been added already
|
rollData.finalResult -= 5 + rollValue // Remove also the dice result has it has been added already
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !rollData.forcedValue) {
|
if (!rollData.forcedValue) {
|
||||||
rollData.adjacentFaces = foundry.utils.duplicate(__facesAdjacentes[rollData.mainDice][rollData.diceValue])
|
rollData.adjacentFaces = foundry.utils.duplicate(__facesAdjacentes[rollData.mainDice][rollData.diceValue])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -451,7 +483,7 @@ export class HeritiersUtility {
|
|||||||
this.computeArmeDegats(rollData, actor)
|
this.computeArmeDegats(rollData, actor)
|
||||||
}
|
}
|
||||||
this.createChatWithRollMode(rollData.alias, {
|
this.createChatWithRollMode(rollData.alias, {
|
||||||
content: await renderTemplate(`systems/fvtt-les-heritiers/templates/chat-cc-result.html`, rollData)
|
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-cc-result.hbs`, rollData)
|
||||||
}, rollData, "selfroll")
|
}, rollData, "selfroll")
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -463,7 +495,7 @@ export class HeritiersUtility {
|
|||||||
this.computeMarge(rollData, valeurDefense)
|
this.computeMarge(rollData, valeurDefense)
|
||||||
rollData.dureeAssommer = (rollData.marge) ? rollData.marge * 2 : 1
|
rollData.dureeAssommer = (rollData.marge) ? rollData.marge * 2 : 1
|
||||||
this.createChatWithRollMode(rollData.alias, {
|
this.createChatWithRollMode(rollData.alias, {
|
||||||
content: await renderTemplate(`systems/fvtt-les-heritiers/templates/chat-assommer-result.html`, rollData)
|
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-assommer-result.hbs`, rollData)
|
||||||
}, rollData, "selfroll")
|
}, rollData, "selfroll")
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@@ -471,12 +503,13 @@ export class HeritiersUtility {
|
|||||||
|
|
||||||
let actor = this.getActorFromRollData(rollData)
|
let actor = this.getActorFromRollData(rollData)
|
||||||
|
|
||||||
if ( rollData.mode == "pouvoir" && actor.getPouvoirUsage(rollData.pouvoir._id) < rollData.pouvoirPointsUsage) {
|
if (rollData.mode == "pouvoir" && actor.getPouvoirUsage(rollData.pouvoir._id) < rollData.pouvoirPointsUsage) {
|
||||||
ui.notifications.warn("Pas assez de points d'usage pour ce pouvoir.")
|
ui.notifications.warn("Pas assez de points d'usage pour ce pouvoir.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//rollData.actionImg = "systems/fvtt-les-heritiers/assets/icons/" + actor.system.attributs[rollData.attrKey].labelnorm + ".webp"
|
//rollData.actionImg = "systems/fvtt-les-heritiers/assets/icons/" + actor.system.attributs[rollData.attrKey].labelnorm + ".webp"
|
||||||
|
if (rollData.caracKey == "pre") rollData.caracKey = "pres"; // Patch tomanage wrong carac key
|
||||||
rollData.carac = foundry.utils.duplicate(actor.system.caracteristiques[rollData.caracKey])
|
rollData.carac = foundry.utils.duplicate(actor.system.caracteristiques[rollData.caracKey])
|
||||||
|
|
||||||
if (rollData.forcedValue) {
|
if (rollData.forcedValue) {
|
||||||
@@ -486,7 +519,7 @@ export class HeritiersUtility {
|
|||||||
rollData.diceFormula = "{1d8, 1d10, 1d12}"
|
rollData.diceFormula = "{1d8, 1d10, 1d12}"
|
||||||
} else {
|
} else {
|
||||||
rollData.diceFormula = "1" + rollData.mainDice + "kh1"
|
rollData.diceFormula = "1" + rollData.mainDice + "kh1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let rangValue = 0
|
let rangValue = 0
|
||||||
@@ -535,13 +568,17 @@ export class HeritiersUtility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !rollData.noRoll) {
|
if (!rollData.noRoll) {
|
||||||
let myRoll = await new Roll(rollData.diceFormula).roll()
|
let myRoll = await new Roll(rollData.diceFormula).roll()
|
||||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||||
rollData.roll = foundry.utils.duplicate(myRoll)
|
rollData.roll = foundry.utils.duplicate(myRoll)
|
||||||
console.log(">>>> ", myRoll)
|
console.log(">>>> ", myRoll)
|
||||||
this.computeResult(actor, rollData)
|
this.computeResult(actor, rollData)
|
||||||
this.computeMarge(rollData, rollData.sdValue) // Calcul de la marge si seuil présent
|
this.computeMarge(rollData, rollData.sdValue) // Calcul de la marge si seuil présent
|
||||||
|
// Compute weapon damage for successful attacks
|
||||||
|
if (rollData.arme && rollData.isSuccess) {
|
||||||
|
this.computeArmeDegats(rollData, actor)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rollData.mode == "init") {
|
if (rollData.mode == "init") {
|
||||||
@@ -552,9 +589,20 @@ export class HeritiersUtility {
|
|||||||
if (rollData.mode == "pouvoir" || rollData.mode == "pouvoirpassif") {
|
if (rollData.mode == "pouvoir" || rollData.mode == "pouvoirpassif") {
|
||||||
actor.incDecPointsUsage(rollData.pouvoir._id, -rollData.pouvoirPointsUsage)
|
actor.incDecPointsUsage(rollData.pouvoir._id, -rollData.pouvoirPointsUsage)
|
||||||
}
|
}
|
||||||
|
// Gestion sort et points d'âme
|
||||||
|
if (rollData.mode == "sort") {
|
||||||
|
if (rollData.spendEsprit) {
|
||||||
|
actor.inDecCarac("esp", -rollData.totalEsprit)
|
||||||
|
} else {
|
||||||
|
actor.incDecPointsAme(-rollData.sortPointsAme)
|
||||||
|
if (rollData.sort.system.competence == "Magie du Clan") {
|
||||||
|
actor.incDecPV(-2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.createChatWithRollMode(rollData.alias, {
|
this.createChatWithRollMode(rollData.alias, {
|
||||||
content: await renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.html`, rollData)
|
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.hbs`, rollData)
|
||||||
}, rollData)
|
}, rollData)
|
||||||
|
|
||||||
// Gestion attaque standard
|
// Gestion attaque standard
|
||||||
@@ -592,7 +640,7 @@ export class HeritiersUtility {
|
|||||||
this.computeResult(rollData)
|
this.computeResult(rollData)
|
||||||
|
|
||||||
this.createChatWithRollMode(rollData.alias, {
|
this.createChatWithRollMode(rollData.alias, {
|
||||||
content: await renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.html`, rollData)
|
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.hbs`, rollData)
|
||||||
}, rollData)
|
}, rollData)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -765,13 +813,13 @@ export class HeritiersUtility {
|
|||||||
static chatRollMenu(html, options) {
|
static chatRollMenu(html, options) {
|
||||||
let canApply = li => canvas.tokens.controlled.length && li.find(".heritiers-roll").length
|
let canApply = li => canvas.tokens.controlled.length && li.find(".heritiers-roll").length
|
||||||
let canApplyBA = function (li) {
|
let canApplyBA = function (li) {
|
||||||
let message = game.messages.get(li.attr("data-message-id"))
|
let message = game.messages.get($(li).attr("data-message-id"))
|
||||||
let rollData = message.getFlag("world", "heritiers-roll")
|
let rollData = message.getFlag("world", "heritiers-roll")
|
||||||
let actor = this.getActorFromRollData(rollData)
|
let actor = this.getActorFromRollData(rollData)
|
||||||
return (!rollData.isReroll && actor.getBonneAventure() > 0)
|
return (!rollData.isReroll && actor.getBonneAventure() > 0)
|
||||||
}
|
}
|
||||||
let canApplyPE = function (li) {
|
let canApplyPE = function (li) {
|
||||||
let message = game.messages.get(li.attr("data-message-id"))
|
let message = game.messages.get($(li).attr("data-message-id"))
|
||||||
let rollData = message.getFlag("world", "heritiers-roll")
|
let rollData = message.getFlag("world", "heritiers-roll")
|
||||||
let actor = this.getActorFromRollData(rollData)
|
let actor = this.getActorFromRollData(rollData)
|
||||||
return (!rollData.isReroll && actor.getEclat() > 0)
|
return (!rollData.isReroll && actor.getEclat() > 0)
|
||||||
@@ -805,25 +853,30 @@ export class HeritiersUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async confirmDelete(actorSheet, li) {
|
static async confirmDelete(actorSheet, li) {
|
||||||
let itemId = li.data("item-id");
|
// Support both jQuery and native elements
|
||||||
let msgTxt = "<p>Are you sure to remove this Item ?";
|
let itemId = li.dataset ? li.dataset.itemId : li.data("item-id");
|
||||||
|
let msgTxt = "<p>Certain de supprimer cet item ?";
|
||||||
let buttons = {
|
let buttons = {
|
||||||
delete: {
|
delete: {
|
||||||
icon: '<i class="fas fa-check"></i>',
|
icon: '<i class="fas fa-check"></i>',
|
||||||
label: "Yes, remove it",
|
label: "Oui !",
|
||||||
callback: () => {
|
callback: () => {
|
||||||
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
|
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
|
||||||
li.slideUp(200, () => actorSheet.render(false));
|
if (li.slideUp) {
|
||||||
|
li.slideUp(200, () => actorSheet.render(false));
|
||||||
|
} else {
|
||||||
|
actorSheet.render(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cancel: {
|
cancel: {
|
||||||
icon: '<i class="fas fa-times"></i>',
|
icon: '<i class="fas fa-times"></i>',
|
||||||
label: "Cancel"
|
label: "Non !"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
msgTxt += "</p>";
|
msgTxt += "</p>";
|
||||||
let d = new Dialog({
|
let d = new Dialog({
|
||||||
title: "Confirm removal",
|
title: "Confirmer la suppression",
|
||||||
content: msgTxt,
|
content: msgTxt,
|
||||||
buttons: buttons,
|
buttons: buttons,
|
||||||
default: "cancel"
|
default: "cancel"
|
||||||
@@ -831,21 +884,56 @@ export class HeritiersUtility {
|
|||||||
d.render(true);
|
d.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************/
|
static loadSort() {
|
||||||
static async __create_talents_table() {
|
// Create afolder in the item directory if it doesn't exist
|
||||||
let compName = "fvtt-les-heritiers.talents-cellule"
|
if (!game.folders.getName("Magie du Clan")) {
|
||||||
const compData = await HeritiersUtility.loadCompendium(compName)
|
Folder.create({
|
||||||
let talents = compData.map(i => i.toObject())
|
name: "Magie du Clan",
|
||||||
|
type: "Item",
|
||||||
let htmlTab = "<table border='1'><tbody>";
|
color: "#3b1361"
|
||||||
for (let entryData of talents) {
|
});
|
||||||
console.log(entryData)
|
|
||||||
htmlTab += `<tr><td>@UUID[Compendium.${compName}.${entryData._id}]{${entryData.name}}</td>`
|
|
||||||
htmlTab += `<td>${entryData.system.description}</td>`;
|
|
||||||
//htmlTab += `<td>${entryData.system.resumebonus}</td>`;
|
|
||||||
htmlTab += "</tr>\n";
|
|
||||||
}
|
}
|
||||||
htmlTab += "</table>";
|
|
||||||
await JournalEntry.create({ name: 'Liste des Talents de Cellule', content: htmlTab });
|
// Load the srcdata/sorts-druidisme.json file
|
||||||
|
return fetch("systems/fvtt-les-heritiers/srcdata/sort_magieduclan.json")
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
console.log("Sorts Magie du Clan loaded:", data);
|
||||||
|
this.sortDruidisme = data;
|
||||||
|
// Loop through the spell and create the "sort "item based on the JSON content
|
||||||
|
data.forEach(spell => {
|
||||||
|
spell.name = spell.name;
|
||||||
|
spell.type = "sort";
|
||||||
|
spell.system = {
|
||||||
|
niveau: spell.niveau,
|
||||||
|
competence: spell.competence,
|
||||||
|
carac1: spell.carac1,
|
||||||
|
carac2: spell.carac2,
|
||||||
|
description: spell.description,
|
||||||
|
ingredients: spell.ingredients,
|
||||||
|
portee: spell.portee,
|
||||||
|
duree: spell.duree,
|
||||||
|
concentration: spell.concentration,
|
||||||
|
critique: spell.critique,
|
||||||
|
resistance: spell.resistance,
|
||||||
|
coutactivation: spell.coutactivation
|
||||||
|
};
|
||||||
|
spell.img = "systems/fvtt-les-heritiers/assets/icons/sort.webp";
|
||||||
|
spell.folder = game.folders.getName("Magie du Clan").id;
|
||||||
|
|
||||||
|
// Create the item in the world
|
||||||
|
Item.create(spell)
|
||||||
|
.then(item => {
|
||||||
|
console.log("Sort created:", item);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error creating sort item:", error);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error loading druidism spells:", error);
|
||||||
|
return [];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
modules/models/accessoire.mjs
Normal file
16
modules/models/accessoire.mjs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les accessoires
|
||||||
|
*/
|
||||||
|
export default class AccessoireDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
description: new fields.HTMLField({ initial: "" }),
|
||||||
|
rarete: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
quantite: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
prix: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
equipped: new fields.BooleanField({ initial: false }),
|
||||||
|
lieu: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
30
modules/models/arme.mjs
Normal file
30
modules/models/arme.mjs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les armes
|
||||||
|
*/
|
||||||
|
export default class ArmeDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
description: new fields.HTMLField({ initial: "" }),
|
||||||
|
rarete: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
quantite: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
prix: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
equipped: new fields.BooleanField({ initial: false }),
|
||||||
|
categorie: new fields.StringField({ initial: "" }),
|
||||||
|
armetype: new fields.StringField({ initial: "" }),
|
||||||
|
degats: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
precision: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
cadence: new fields.StringField({ initial: "" }),
|
||||||
|
enraiement: new fields.StringField({ initial: "" }),
|
||||||
|
magasin: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
charge: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
portee: new fields.StringField({ initial: "" }),
|
||||||
|
legalite: new fields.StringField({ initial: "" }),
|
||||||
|
dissimulation: new fields.StringField({ initial: "" }),
|
||||||
|
zone: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
temps: new fields.StringField({ initial: "" }),
|
||||||
|
allumage: new fields.StringField({ initial: "" }),
|
||||||
|
special: new fields.StringField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
11
modules/models/atoutfeerique.mjs
Normal file
11
modules/models/atoutfeerique.mjs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les atouts féériques
|
||||||
|
*/
|
||||||
|
export default class AtoutFeeriqueDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
11
modules/models/avantage.mjs
Normal file
11
modules/models/avantage.mjs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les avantages
|
||||||
|
*/
|
||||||
|
export default class AvantageDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
11
modules/models/base-item.mjs
Normal file
11
modules/models/base-item.mjs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Base data model pour les items
|
||||||
|
*/
|
||||||
|
export default class BaseItemDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
21
modules/models/capacitenaturelle.mjs
Normal file
21
modules/models/capacitenaturelle.mjs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les capacités naturelles
|
||||||
|
*/
|
||||||
|
export default class CapaciteNaturelleDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
pouvoirtype: new fields.StringField({ initial: "" }),
|
||||||
|
activation: new fields.StringField({ initial: "" }),
|
||||||
|
cibles: new fields.StringField({ initial: "" }),
|
||||||
|
effet: new fields.StringField({ initial: "" }),
|
||||||
|
duree: new fields.StringField({ initial: "" }),
|
||||||
|
portee: new fields.StringField({ initial: "" }),
|
||||||
|
resistance: new fields.StringField({ initial: "" }),
|
||||||
|
resistanceautre: new fields.StringField({ initial: "" }),
|
||||||
|
isvirulence: new fields.BooleanField({ initial: false }),
|
||||||
|
virulence: new fields.StringField({ initial: "" }),
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
43
modules/models/competence.mjs
Normal file
43
modules/models/competence.mjs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les compétences
|
||||||
|
*/
|
||||||
|
export default class CompetenceDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
categorie: new fields.StringField({ initial: "" }),
|
||||||
|
profil: new fields.StringField({ initial: "" }),
|
||||||
|
niveau: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
nomniveau: new fields.SchemaField({
|
||||||
|
1: new fields.StringField({ initial: "" }),
|
||||||
|
2: new fields.StringField({ initial: "" }),
|
||||||
|
3: new fields.StringField({ initial: "" }),
|
||||||
|
4: new fields.StringField({ initial: "" })
|
||||||
|
}),
|
||||||
|
nomniveausouffle: new fields.SchemaField({
|
||||||
|
soufflecombat: new fields.SchemaField({
|
||||||
|
1: new fields.StringField({ initial: "" }),
|
||||||
|
2: new fields.StringField({ initial: "" }),
|
||||||
|
3: new fields.StringField({ initial: "" }),
|
||||||
|
4: new fields.StringField({ initial: "" })
|
||||||
|
}),
|
||||||
|
soufflemouvement: new fields.SchemaField({
|
||||||
|
1: new fields.StringField({ initial: "" }),
|
||||||
|
2: new fields.StringField({ initial: "" }),
|
||||||
|
3: new fields.StringField({ initial: "" }),
|
||||||
|
4: new fields.StringField({ initial: "" })
|
||||||
|
}),
|
||||||
|
souffleesprit: new fields.SchemaField({
|
||||||
|
1: new fields.StringField({ initial: "" }),
|
||||||
|
2: new fields.StringField({ initial: "" }),
|
||||||
|
3: new fields.StringField({ initial: "" }),
|
||||||
|
4: new fields.StringField({ initial: "" })
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
predilection: new fields.BooleanField({ initial: false }),
|
||||||
|
specialites: new fields.ArrayField(new fields.ObjectField(), { initial: [] }),
|
||||||
|
ismagie: new fields.BooleanField({ initial: false }),
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
12
modules/models/contact.mjs
Normal file
12
modules/models/contact.mjs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les contacts
|
||||||
|
*/
|
||||||
|
export default class ContactDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
contacttype: new fields.StringField({ initial: "contact" }),
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
11
modules/models/desavantage.mjs
Normal file
11
modules/models/desavantage.mjs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les désavantages
|
||||||
|
*/
|
||||||
|
export default class DesavantageDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
15
modules/models/equipement.mjs
Normal file
15
modules/models/equipement.mjs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les équipements
|
||||||
|
*/
|
||||||
|
export default class EquipementDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
description: new fields.HTMLField({ initial: "" }),
|
||||||
|
rarete: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
quantite: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
prix: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
equipped: new fields.BooleanField({ initial: false })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
19
modules/models/fee.mjs
Normal file
19
modules/models/fee.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les fées
|
||||||
|
*/
|
||||||
|
export default class FeeDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
feetype: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
avantages: new fields.StringField({ initial: "" }),
|
||||||
|
desavantages: new fields.StringField({ initial: "" }),
|
||||||
|
pouvoirsfeeriquesmasque: new fields.StringField({ initial: "" }),
|
||||||
|
pouvoirsfeeriquesdemasque: new fields.StringField({ initial: "" }),
|
||||||
|
atoutsfeeriques: new fields.StringField({ initial: "" }),
|
||||||
|
competences: new fields.StringField({ initial: "" }),
|
||||||
|
capacitenaturelles: new fields.StringField({ initial: "" }),
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
24
modules/models/index.mjs
Normal file
24
modules/models/index.mjs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Index des DataModels pour Les Héritiers
|
||||||
|
* Ce fichier centralise tous les exports des modèles de données
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Modèles d'acteurs
|
||||||
|
export { default as PersonnageDataModel } from './personnage.mjs';
|
||||||
|
export { default as PnjDataModel } from './pnj.mjs';
|
||||||
|
|
||||||
|
// Modèles d'items
|
||||||
|
export { default as AccessoireDataModel } from './accessoire.mjs';
|
||||||
|
export { default as ArmeDataModel } from './arme.mjs';
|
||||||
|
export { default as AtoutFeeriqueDataModel } from './atoutfeerique.mjs';
|
||||||
|
export { default as AvantageDataModel } from './avantage.mjs';
|
||||||
|
export { default as CapaciteNaturelleDataModel } from './capacitenaturelle.mjs';
|
||||||
|
export { default as CompetenceDataModel } from './competence.mjs';
|
||||||
|
export { default as ContactDataModel } from './contact.mjs';
|
||||||
|
export { default as DesavantageDataModel } from './desavantage.mjs';
|
||||||
|
export { default as EquipementDataModel } from './equipement.mjs';
|
||||||
|
export { default as FeeDataModel } from './fee.mjs';
|
||||||
|
export { default as PouvoirDataModel } from './pouvoir.mjs';
|
||||||
|
export { default as ProfilDataModel } from './profil.mjs';
|
||||||
|
export { default as ProtectionDataModel } from './protection.mjs';
|
||||||
|
export { default as SortDataModel } from './sort.mjs';
|
||||||
234
modules/models/personnage.mjs
Normal file
234
modules/models/personnage.mjs
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les personnages
|
||||||
|
*/
|
||||||
|
export default class PersonnageDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
// Template biodata
|
||||||
|
biodata: new fields.SchemaField({
|
||||||
|
name: new fields.StringField({ initial: "" }),
|
||||||
|
activite: new fields.StringField({ initial: "" }),
|
||||||
|
nomhumain: new fields.StringField({ initial: "" }),
|
||||||
|
activites: new fields.StringField({ initial: "" }),
|
||||||
|
fortune: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
traitscaracteres: new fields.StringField({ initial: "" }),
|
||||||
|
tailledemasquee: new fields.StringField({ initial: "" }),
|
||||||
|
taillemasquee: new fields.StringField({ initial: "" }),
|
||||||
|
poidsmasquee: new fields.StringField({ initial: "" }),
|
||||||
|
poidsdemasquee: new fields.StringField({ initial: "" }),
|
||||||
|
apparencemasquee: new fields.StringField({ initial: "" }),
|
||||||
|
apparencedemasquee: new fields.StringField({ initial: "" }),
|
||||||
|
titrefamille: new fields.StringField({ initial: "" }),
|
||||||
|
langues: new fields.StringField({ initial: "" }),
|
||||||
|
factionfeerique: new fields.StringField({ initial: "" }),
|
||||||
|
typetaille: new fields.StringField({ initial: "" }),
|
||||||
|
age: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
poids: new fields.StringField({ initial: "" }),
|
||||||
|
taille: new fields.StringField({ initial: "" }),
|
||||||
|
cheveux: new fields.StringField({ initial: "" }),
|
||||||
|
sexe: new fields.StringField({ initial: "" }),
|
||||||
|
yeux: new fields.StringField({ initial: "" }),
|
||||||
|
description: new fields.HTMLField({ initial: "" }),
|
||||||
|
revesetranges: new fields.HTMLField({ initial: "" }),
|
||||||
|
secretsdecouverts: new fields.HTMLField({ initial: "" }),
|
||||||
|
questions: new fields.HTMLField({ initial: "" }),
|
||||||
|
habitat: new fields.HTMLField({ initial: "" }),
|
||||||
|
notes: new fields.HTMLField({ initial: "" }),
|
||||||
|
statut: new fields.StringField({ initial: "" }),
|
||||||
|
playernotes: new fields.HTMLField({ initial: "" }),
|
||||||
|
gmnotes: new fields.HTMLField({ initial: "" }),
|
||||||
|
magie: new fields.BooleanField({ initial: false })
|
||||||
|
}),
|
||||||
|
// Template core
|
||||||
|
subactors: new fields.ArrayField(new fields.StringField(), { initial: [] }),
|
||||||
|
caracteristiques: new fields.SchemaField({
|
||||||
|
agi: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Agilité" }),
|
||||||
|
labelnorm: new fields.StringField({ initial: "agilite" }),
|
||||||
|
abbrev: new fields.StringField({ initial: "agi" }),
|
||||||
|
kind: new fields.StringField({ initial: "physical" }),
|
||||||
|
value: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 1, integer: true })
|
||||||
|
}),
|
||||||
|
con: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Constitution" }),
|
||||||
|
labelnorm: new fields.StringField({ initial: "constitution" }),
|
||||||
|
abbrev: new fields.StringField({ initial: "con" }),
|
||||||
|
kind: new fields.StringField({ initial: "physical" }),
|
||||||
|
value: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 1, integer: true })
|
||||||
|
}),
|
||||||
|
for: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Force" }),
|
||||||
|
labelnorm: new fields.StringField({ initial: "force" }),
|
||||||
|
abbrev: new fields.StringField({ initial: "for" }),
|
||||||
|
kind: new fields.StringField({ initial: "physical" }),
|
||||||
|
value: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 1, integer: true })
|
||||||
|
}),
|
||||||
|
prec: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Précision" }),
|
||||||
|
labelnorm: new fields.StringField({ initial: "precision" }),
|
||||||
|
abbrev: new fields.StringField({ initial: "prec" }),
|
||||||
|
kind: new fields.StringField({ initial: "physical" }),
|
||||||
|
value: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 1, integer: true })
|
||||||
|
}),
|
||||||
|
esp: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Esprit" }),
|
||||||
|
labelnorm: new fields.StringField({ initial: "esprit" }),
|
||||||
|
abbrev: new fields.StringField({ initial: "esp" }),
|
||||||
|
kind: new fields.StringField({ initial: "mental" }),
|
||||||
|
value: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 1, integer: true })
|
||||||
|
}),
|
||||||
|
per: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Perception" }),
|
||||||
|
labelnorm: new fields.StringField({ initial: "perception" }),
|
||||||
|
abbrev: new fields.StringField({ initial: "per" }),
|
||||||
|
kind: new fields.StringField({ initial: "mental" }),
|
||||||
|
value: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 1, integer: true })
|
||||||
|
}),
|
||||||
|
pres: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Prestance" }),
|
||||||
|
labelnorm: new fields.StringField({ initial: "pres" }),
|
||||||
|
abbrev: new fields.StringField({ initial: "pres" }),
|
||||||
|
kind: new fields.StringField({ initial: "mental" }),
|
||||||
|
value: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 1, integer: true })
|
||||||
|
}),
|
||||||
|
san: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Sang-Froid" }),
|
||||||
|
labelnorm: new fields.StringField({ initial: "sangfroid" }),
|
||||||
|
abbrev: new fields.StringField({ initial: "san" }),
|
||||||
|
kind: new fields.StringField({ initial: "mental" }),
|
||||||
|
value: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 1, integer: true })
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
statutmasque: new fields.StringField({ initial: "masque" }),
|
||||||
|
rang: new fields.SchemaField({
|
||||||
|
tricherie: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Tricherie" }),
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
feerie: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Féerie" }),
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
masque: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Masque" }),
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
heritage: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Héritage" }),
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
scenarios: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
pv: new fields.SchemaField({
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
mod: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
competences: new fields.SchemaField({
|
||||||
|
aventurier: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Aventurier" }),
|
||||||
|
niveau: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
pp: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
combattant: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Combattant" }),
|
||||||
|
niveau: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
pp: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
erudit: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Erudit" }),
|
||||||
|
niveau: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
pp: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
gentleman: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Gentleman" }),
|
||||||
|
niveau: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
pp: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
roublard: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Roublard" }),
|
||||||
|
niveau: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
pp: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
savant: new fields.SchemaField({
|
||||||
|
label: new fields.StringField({ initial: "Savant" }),
|
||||||
|
niveau: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
rang: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
pp: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
magie: new fields.SchemaField({
|
||||||
|
pointsame: new fields.SchemaField({
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
max: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
experience: new fields.SchemaField({
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
pourtricher: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
combat: new fields.SchemaField({
|
||||||
|
esquive: new fields.SchemaField({
|
||||||
|
masquee: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
demasquee: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
parade: new fields.SchemaField({
|
||||||
|
masquee: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
demasquee: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
resistancephysique: new fields.SchemaField({
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
resistancepsychique: new fields.SchemaField({
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
protection: new fields.SchemaField({
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
effetssecondaires: new fields.StringField({ initial: "" }),
|
||||||
|
dissimulation: new fields.SchemaField({
|
||||||
|
value: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
initiative: new fields.SchemaField({
|
||||||
|
masquee: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
demasquee: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
corpsacorps: new fields.SchemaField({
|
||||||
|
masquee: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
demasquee: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
|
tir: new fields.SchemaField({
|
||||||
|
masquee: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
demasquee: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
10
modules/models/pnj.mjs
Normal file
10
modules/models/pnj.mjs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les PNJ
|
||||||
|
* Utilise le même schéma que les personnages
|
||||||
|
*/
|
||||||
|
import PersonnageDataModel from './personnage.mjs';
|
||||||
|
|
||||||
|
export default class PnjDataModel extends PersonnageDataModel {
|
||||||
|
// Les PNJ utilisent exactement le même schéma que les personnages
|
||||||
|
// On hérite simplement de PersonnageDataModel
|
||||||
|
}
|
||||||
29
modules/models/pouvoir.mjs
Normal file
29
modules/models/pouvoir.mjs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les pouvoirs
|
||||||
|
*/
|
||||||
|
export default class PouvoirDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
pouvoirtype: new fields.StringField({ initial: "" }),
|
||||||
|
masquetype: new fields.StringField({ initial: "" }),
|
||||||
|
niveau: new fields.StringField({ initial: "" }),
|
||||||
|
activation: new fields.StringField({ initial: "" }),
|
||||||
|
istest: new fields.BooleanField({ initial: false }),
|
||||||
|
feeriemasque: new fields.StringField({ initial: "feerie" }),
|
||||||
|
zoneffet: new fields.StringField({ initial: "" }),
|
||||||
|
testautre: new fields.StringField({ initial: "" }),
|
||||||
|
carac: new fields.StringField({ initial: "pre" }),
|
||||||
|
duree: new fields.StringField({ initial: "" }),
|
||||||
|
cibles: new fields.StringField({ initial: "" }),
|
||||||
|
effet: new fields.StringField({ initial: "" }),
|
||||||
|
portee: new fields.StringField({ initial: "" }),
|
||||||
|
resistance: new fields.StringField({ initial: "" }),
|
||||||
|
resistanceautre: new fields.StringField({ initial: "" }),
|
||||||
|
pointsusagecourant: new fields.NumberField({ initial: -1, integer: true }),
|
||||||
|
isvirulence: new fields.BooleanField({ initial: false }),
|
||||||
|
virulence: new fields.StringField({ initial: "" }),
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
12
modules/models/profil.mjs
Normal file
12
modules/models/profil.mjs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les profils
|
||||||
|
*/
|
||||||
|
export default class ProfilDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
profiltype: new fields.StringField({ initial: "majeur" }),
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
20
modules/models/protection.mjs
Normal file
20
modules/models/protection.mjs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les protections
|
||||||
|
*/
|
||||||
|
export default class ProtectionDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
description: new fields.HTMLField({ initial: "" }),
|
||||||
|
rarete: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
quantite: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
prix: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
equipped: new fields.BooleanField({ initial: false }),
|
||||||
|
points: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
protectiontype: new fields.StringField({ initial: "" }),
|
||||||
|
effetsecondaire: new fields.StringField({ initial: "" }),
|
||||||
|
malusagilite: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
dissimulation: new fields.StringField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
27
modules/models/sort.mjs
Normal file
27
modules/models/sort.mjs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* Data model pour les sorts
|
||||||
|
*/
|
||||||
|
export default class SortDataModel extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return {
|
||||||
|
niveau: new fields.StringField({ initial: "1" }),
|
||||||
|
rang: new fields.StringField({ initial: "1" }),
|
||||||
|
competence: new fields.StringField({ initial: "Druidisme" }),
|
||||||
|
carac1: new fields.StringField({ initial: "esp" }),
|
||||||
|
carac2: new fields.StringField({ initial: "none" }),
|
||||||
|
sdspecial: new fields.StringField({ initial: "" }),
|
||||||
|
duree: new fields.StringField({ initial: "" }),
|
||||||
|
portee: new fields.StringField({ initial: "" }),
|
||||||
|
concentration: new fields.StringField({ initial: "" }),
|
||||||
|
informatif: new fields.BooleanField({ initial: false }),
|
||||||
|
texteinformatif: new fields.StringField({ initial: "" }),
|
||||||
|
critique: new fields.StringField({ initial: "" }),
|
||||||
|
ingredients: new fields.StringField({ initial: "" }),
|
||||||
|
resistance: new fields.StringField({ initial: "" }),
|
||||||
|
coutactivation: new fields.StringField({ initial: "" }),
|
||||||
|
souffle: new fields.StringField({ initial: "" }),
|
||||||
|
description: new fields.HTMLField({ initial: "" })
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
4971
package-lock.json
generated
Normal file
4971
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
16
package.json
Normal file
16
package.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"name": "fvtt-les-heritiers",
|
||||||
|
"version": "13.0.7",
|
||||||
|
"description": "Les Héritiers RPG for FoundryVTT (French)",
|
||||||
|
"scripts": {
|
||||||
|
"build": "gulp build",
|
||||||
|
"watch": "gulp watch"
|
||||||
|
},
|
||||||
|
"author": "Uberwald/LeRatierBretonnien",
|
||||||
|
"license": "SEE LICENSE IN LICENCE.txt",
|
||||||
|
"devDependencies": {
|
||||||
|
"gulp": "^4.0.2",
|
||||||
|
"gulp-less": "^5.0.0",
|
||||||
|
"gulp-sourcemaps": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
BIN
packs/archetypes-fees/000179.ldb
Normal file
BIN
packs/archetypes-fees/000179.ldb
Normal file
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000102
|
MANIFEST-000308
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
2024/05/23-10:57:45.623302 7f80456006c0 Recovering log #100
|
2026/01/10-17:13:21.499762 7fd462ffd6c0 Recovering log #306
|
||||||
2024/05/23-10:57:45.634017 7f80456006c0 Delete type=3 #98
|
2026/01/10-17:13:21.510831 7fd462ffd6c0 Delete type=3 #304
|
||||||
2024/05/23-10:57:45.634148 7f80456006c0 Delete type=0 #100
|
2026/01/10-17:13:21.511011 7fd462ffd6c0 Delete type=0 #306
|
||||||
2024/05/23-11:25:01.407869 7f803fe006c0 Level-0 table #105: started
|
2026/01/10-22:35:10.944218 7fd4627fc6c0 Level-0 table #311: started
|
||||||
2024/05/23-11:25:01.412121 7f803fe006c0 Level-0 table #105: 76980 bytes OK
|
2026/01/10-22:35:10.944249 7fd4627fc6c0 Level-0 table #311: 0 bytes OK
|
||||||
2024/05/23-11:25:01.418196 7f803fe006c0 Delete type=0 #103
|
2026/01/10-22:35:10.950116 7fd4627fc6c0 Delete type=0 #309
|
||||||
2024/05/23-11:25:01.442441 7f803fe006c0 Manual compaction at level-0 from '!items!1NhJH4IJpxsGmLB8' @ 72057594037927935 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at (end)
|
2026/01/10-22:35:10.963623 7fd4627fc6c0 Manual compaction at level-0 from '!items!1NhJH4IJpxsGmLB8' @ 72057594037927935 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.466948 7f803fe006c0 Manual compaction at level-1 from '!items!1NhJH4IJpxsGmLB8' @ 72057594037927935 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at '!items!y1yOenfAJTsb3r6e' @ 62 : 1
|
2026/01/10-22:35:10.963688 7fd4627fc6c0 Manual compaction at level-1 from '!items!1NhJH4IJpxsGmLB8' @ 72057594037927935 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.466958 7f803fe006c0 Compacting 1@1 + 1@2 files
|
|
||||||
2024/05/23-11:25:01.471640 7f803fe006c0 Generated table #106@1: 31 keys, 76980 bytes
|
|
||||||
2024/05/23-11:25:01.471673 7f803fe006c0 Compacted 1@1 + 1@2 files => 76980 bytes
|
|
||||||
2024/05/23-11:25:01.477983 7f803fe006c0 compacted to: files[ 0 0 1 0 0 0 0 ]
|
|
||||||
2024/05/23-11:25:01.478100 7f803fe006c0 Delete type=2 #5
|
|
||||||
2024/05/23-11:25:01.478228 7f803fe006c0 Delete type=2 #105
|
|
||||||
2024/05/23-11:25:01.488781 7f803fe006c0 Manual compaction at level-1 from '!items!y1yOenfAJTsb3r6e' @ 62 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2024/04/24-21:03:14.407753 7fcc5fe006c0 Recovering log #96
|
2026/01/10-16:36:53.969467 7fd4637fe6c0 Recovering log #302
|
||||||
2024/04/24-21:03:14.418285 7fcc5fe006c0 Delete type=3 #94
|
2026/01/10-16:36:53.980503 7fd4637fe6c0 Delete type=3 #300
|
||||||
2024/04/24-21:03:14.418386 7fcc5fe006c0 Delete type=0 #96
|
2026/01/10-16:36:53.980609 7fd4637fe6c0 Delete type=0 #302
|
||||||
2024/04/24-21:12:06.758987 7fcc5e4006c0 Level-0 table #101: started
|
2026/01/10-17:13:09.472065 7fd4627fc6c0 Level-0 table #307: started
|
||||||
2024/04/24-21:12:06.759009 7fcc5e4006c0 Level-0 table #101: 0 bytes OK
|
2026/01/10-17:13:09.472120 7fd4627fc6c0 Level-0 table #307: 0 bytes OK
|
||||||
2024/04/24-21:12:06.766071 7fcc5e4006c0 Delete type=0 #99
|
2026/01/10-17:13:09.478554 7fd4627fc6c0 Delete type=0 #305
|
||||||
2024/04/24-21:12:06.772507 7fcc5e4006c0 Manual compaction at level-0 from '!items!1NhJH4IJpxsGmLB8' @ 72057594037927935 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.492266 7fd4627fc6c0 Manual compaction at level-0 from '!items!1NhJH4IJpxsGmLB8' @ 72057594037927935 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at (end)
|
||||||
2024/04/24-21:12:06.780581 7fcc5e4006c0 Manual compaction at level-1 from '!items!1NhJH4IJpxsGmLB8' @ 72057594037927935 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.492326 7fd4627fc6c0 Manual compaction at level-1 from '!items!1NhJH4IJpxsGmLB8' @ 72057594037927935 : 1 .. '!items!y1yOenfAJTsb3r6e' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
BIN
packs/archetypes-fees/MANIFEST-000308
Normal file
BIN
packs/archetypes-fees/MANIFEST-000308
Normal file
Binary file not shown.
Binary file not shown.
BIN
packs/armes-et-protection/000179.ldb
Normal file
BIN
packs/armes-et-protection/000179.ldb
Normal file
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000102
|
MANIFEST-000308
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
2024/05/23-10:57:45.655135 7f8046a006c0 Recovering log #100
|
2026/01/10-17:13:21.528896 7fd478fff6c0 Recovering log #306
|
||||||
2024/05/23-10:57:45.665774 7f8046a006c0 Delete type=3 #98
|
2026/01/10-17:13:21.539812 7fd478fff6c0 Delete type=3 #304
|
||||||
2024/05/23-10:57:45.665849 7f8046a006c0 Delete type=0 #100
|
2026/01/10-17:13:21.539902 7fd478fff6c0 Delete type=0 #306
|
||||||
2024/05/23-11:25:01.418338 7f803fe006c0 Level-0 table #105: started
|
2026/01/10-22:35:10.963778 7fd4627fc6c0 Level-0 table #311: started
|
||||||
2024/05/23-11:25:01.422571 7f803fe006c0 Level-0 table #105: 17369 bytes OK
|
2026/01/10-22:35:10.963855 7fd4627fc6c0 Level-0 table #311: 0 bytes OK
|
||||||
2024/05/23-11:25:01.428914 7f803fe006c0 Delete type=0 #103
|
2026/01/10-22:35:10.969945 7fd4627fc6c0 Delete type=0 #309
|
||||||
2024/05/23-11:25:01.442459 7f803fe006c0 Manual compaction at level-0 from '!items!1ETVaPBtjDtzelK1' @ 72057594037927935 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at (end)
|
2026/01/10-22:35:10.989919 7fd4627fc6c0 Manual compaction at level-0 from '!items!1ETVaPBtjDtzelK1' @ 72057594037927935 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.478313 7f803fe006c0 Manual compaction at level-1 from '!items!1ETVaPBtjDtzelK1' @ 72057594037927935 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at '!items!zbsVCsWxRzkzzG1N' @ 144 : 1
|
2026/01/10-22:35:10.989967 7fd4627fc6c0 Manual compaction at level-1 from '!items!1ETVaPBtjDtzelK1' @ 72057594037927935 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.478324 7f803fe006c0 Compacting 1@1 + 1@2 files
|
|
||||||
2024/05/23-11:25:01.482030 7f803fe006c0 Generated table #106@1: 72 keys, 17369 bytes
|
|
||||||
2024/05/23-11:25:01.482057 7f803fe006c0 Compacted 1@1 + 1@2 files => 17369 bytes
|
|
||||||
2024/05/23-11:25:01.488371 7f803fe006c0 compacted to: files[ 0 0 1 0 0 0 0 ]
|
|
||||||
2024/05/23-11:25:01.488544 7f803fe006c0 Delete type=2 #5
|
|
||||||
2024/05/23-11:25:01.488680 7f803fe006c0 Delete type=2 #105
|
|
||||||
2024/05/23-11:25:01.488790 7f803fe006c0 Manual compaction at level-1 from '!items!zbsVCsWxRzkzzG1N' @ 144 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2024/04/24-21:03:14.434490 7fcc5fe006c0 Recovering log #96
|
2026/01/10-16:36:54.002327 7fd462ffd6c0 Recovering log #302
|
||||||
2024/04/24-21:03:14.445376 7fcc5fe006c0 Delete type=3 #94
|
2026/01/10-16:36:54.012517 7fd462ffd6c0 Delete type=3 #300
|
||||||
2024/04/24-21:03:14.445476 7fcc5fe006c0 Delete type=0 #96
|
2026/01/10-16:36:54.012642 7fd462ffd6c0 Delete type=0 #302
|
||||||
2024/04/24-21:12:06.780592 7fcc5e4006c0 Level-0 table #101: started
|
2026/01/10-17:13:09.492537 7fd4627fc6c0 Level-0 table #307: started
|
||||||
2024/04/24-21:12:06.780614 7fcc5e4006c0 Level-0 table #101: 0 bytes OK
|
2026/01/10-17:13:09.492568 7fd4627fc6c0 Level-0 table #307: 0 bytes OK
|
||||||
2024/04/24-21:12:06.786815 7fcc5e4006c0 Delete type=0 #99
|
2026/01/10-17:13:09.498555 7fd4627fc6c0 Delete type=0 #305
|
||||||
2024/04/24-21:12:06.793537 7fcc5e4006c0 Manual compaction at level-0 from '!items!1ETVaPBtjDtzelK1' @ 72057594037927935 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.518553 7fd4627fc6c0 Manual compaction at level-0 from '!items!1ETVaPBtjDtzelK1' @ 72057594037927935 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at (end)
|
||||||
2024/04/24-21:12:06.800296 7fcc5e4006c0 Manual compaction at level-1 from '!items!1ETVaPBtjDtzelK1' @ 72057594037927935 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.518642 7fd4627fc6c0 Manual compaction at level-1 from '!items!1ETVaPBtjDtzelK1' @ 72057594037927935 : 1 .. '!items!zbsVCsWxRzkzzG1N' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
BIN
packs/armes-et-protection/MANIFEST-000308
Normal file
BIN
packs/armes-et-protection/MANIFEST-000308
Normal file
Binary file not shown.
Binary file not shown.
BIN
packs/atouts-feeriques/000179.ldb
Normal file
BIN
packs/atouts-feeriques/000179.ldb
Normal file
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000102
|
MANIFEST-000308
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
2024/05/23-10:57:45.608985 7f80460006c0 Recovering log #100
|
2026/01/10-17:13:21.469395 7fd4637fe6c0 Recovering log #306
|
||||||
2024/05/23-10:57:45.618959 7f80460006c0 Delete type=3 #98
|
2026/01/10-17:13:21.479611 7fd4637fe6c0 Delete type=3 #304
|
||||||
2024/05/23-10:57:45.619067 7f80460006c0 Delete type=0 #100
|
2026/01/10-17:13:21.479687 7fd4637fe6c0 Delete type=0 #306
|
||||||
2024/05/23-11:25:01.397161 7f803fe006c0 Level-0 table #105: started
|
2026/01/10-22:35:10.919012 7fd4627fc6c0 Level-0 table #311: started
|
||||||
2024/05/23-11:25:01.401554 7f803fe006c0 Level-0 table #105: 63133 bytes OK
|
2026/01/10-22:35:10.919040 7fd4627fc6c0 Level-0 table #311: 0 bytes OK
|
||||||
2024/05/23-11:25:01.407613 7f803fe006c0 Delete type=0 #103
|
2026/01/10-22:35:10.924958 7fd4627fc6c0 Delete type=0 #309
|
||||||
2024/05/23-11:25:01.442406 7f803fe006c0 Manual compaction at level-0 from '!items!0fPXtA5LkLgG8uDj' @ 72057594037927935 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at (end)
|
2026/01/10-22:35:10.937993 7fd4627fc6c0 Manual compaction at level-0 from '!items!0fPXtA5LkLgG8uDj' @ 72057594037927935 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.442493 7f803fe006c0 Manual compaction at level-1 from '!items!0fPXtA5LkLgG8uDj' @ 72057594037927935 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at '!items!zvtBlG6KCIn0oCVk' @ 306 : 1
|
2026/01/10-22:35:10.938027 7fd4627fc6c0 Manual compaction at level-1 from '!items!0fPXtA5LkLgG8uDj' @ 72057594037927935 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.442500 7f803fe006c0 Compacting 1@1 + 1@2 files
|
|
||||||
2024/05/23-11:25:01.447773 7f803fe006c0 Generated table #106@1: 153 keys, 63133 bytes
|
|
||||||
2024/05/23-11:25:01.447818 7f803fe006c0 Compacted 1@1 + 1@2 files => 63133 bytes
|
|
||||||
2024/05/23-11:25:01.453866 7f803fe006c0 compacted to: files[ 0 0 1 0 0 0 0 ]
|
|
||||||
2024/05/23-11:25:01.454036 7f803fe006c0 Delete type=2 #5
|
|
||||||
2024/05/23-11:25:01.454195 7f803fe006c0 Delete type=2 #105
|
|
||||||
2024/05/23-11:25:01.488757 7f803fe006c0 Manual compaction at level-1 from '!items!zvtBlG6KCIn0oCVk' @ 306 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2024/04/24-21:03:14.394982 7fcc64a006c0 Recovering log #96
|
2026/01/10-16:36:53.937580 7fd463fff6c0 Recovering log #302
|
||||||
2024/04/24-21:03:14.405041 7fcc64a006c0 Delete type=3 #94
|
2026/01/10-16:36:53.948656 7fd463fff6c0 Delete type=3 #300
|
||||||
2024/04/24-21:03:14.405101 7fcc64a006c0 Delete type=0 #96
|
2026/01/10-16:36:53.948746 7fd463fff6c0 Delete type=0 #302
|
||||||
2024/04/24-21:12:06.752178 7fcc5e4006c0 Level-0 table #101: started
|
2026/01/10-17:13:09.478691 7fd4627fc6c0 Level-0 table #307: started
|
||||||
2024/04/24-21:12:06.752221 7fcc5e4006c0 Level-0 table #101: 0 bytes OK
|
2026/01/10-17:13:09.478722 7fd4627fc6c0 Level-0 table #307: 0 bytes OK
|
||||||
2024/04/24-21:12:06.758834 7fcc5e4006c0 Delete type=0 #99
|
2026/01/10-17:13:09.485719 7fd4627fc6c0 Delete type=0 #305
|
||||||
2024/04/24-21:12:06.766218 7fcc5e4006c0 Manual compaction at level-0 from '!items!0fPXtA5LkLgG8uDj' @ 72057594037927935 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.492280 7fd4627fc6c0 Manual compaction at level-0 from '!items!0fPXtA5LkLgG8uDj' @ 72057594037927935 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at (end)
|
||||||
2024/04/24-21:12:06.772523 7fcc5e4006c0 Manual compaction at level-1 from '!items!0fPXtA5LkLgG8uDj' @ 72057594037927935 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.492336 7fd4627fc6c0 Manual compaction at level-1 from '!items!0fPXtA5LkLgG8uDj' @ 72057594037927935 : 1 .. '!items!zvtBlG6KCIn0oCVk' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
BIN
packs/atouts-feeriques/MANIFEST-000308
Normal file
BIN
packs/atouts-feeriques/MANIFEST-000308
Normal file
Binary file not shown.
Binary file not shown.
BIN
packs/avantages/000179.ldb
Normal file
BIN
packs/avantages/000179.ldb
Normal file
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000102
|
MANIFEST-000308
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
2024/05/23-10:57:45.566585 7f80456006c0 Recovering log #100
|
2026/01/10-17:13:21.429229 7fd463fff6c0 Recovering log #306
|
||||||
2024/05/23-10:57:45.576456 7f80456006c0 Delete type=3 #98
|
2026/01/10-17:13:21.439355 7fd463fff6c0 Delete type=3 #304
|
||||||
2024/05/23-10:57:45.576513 7f80456006c0 Delete type=0 #100
|
2026/01/10-17:13:21.439437 7fd463fff6c0 Delete type=0 #306
|
||||||
2024/05/23-11:25:01.323826 7f803fe006c0 Level-0 table #105: started
|
2026/01/10-22:35:10.925075 7fd4627fc6c0 Level-0 table #311: started
|
||||||
2024/05/23-11:25:01.327636 7f803fe006c0 Level-0 table #105: 27634 bytes OK
|
2026/01/10-22:35:10.925115 7fd4627fc6c0 Level-0 table #311: 0 bytes OK
|
||||||
2024/05/23-11:25:01.333591 7f803fe006c0 Delete type=0 #103
|
2026/01/10-22:35:10.931575 7fd4627fc6c0 Delete type=0 #309
|
||||||
2024/05/23-11:25:01.354630 7f803fe006c0 Manual compaction at level-0 from '!items!0EAAt0qSzcD9VRBH' @ 72057594037927935 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at (end)
|
2026/01/10-22:35:10.938004 7fd4627fc6c0 Manual compaction at level-0 from '!items!0EAAt0qSzcD9VRBH' @ 72057594037927935 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.364975 7f803fe006c0 Manual compaction at level-1 from '!items!0EAAt0qSzcD9VRBH' @ 72057594037927935 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at '!items!zfpjROW9LDAlXUkN' @ 126 : 1
|
2026/01/10-22:35:10.938039 7fd4627fc6c0 Manual compaction at level-1 from '!items!0EAAt0qSzcD9VRBH' @ 72057594037927935 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.364987 7f803fe006c0 Compacting 1@1 + 1@2 files
|
|
||||||
2024/05/23-11:25:01.368745 7f803fe006c0 Generated table #106@1: 63 keys, 27634 bytes
|
|
||||||
2024/05/23-11:25:01.368762 7f803fe006c0 Compacted 1@1 + 1@2 files => 27634 bytes
|
|
||||||
2024/05/23-11:25:01.375071 7f803fe006c0 compacted to: files[ 0 0 1 0 0 0 0 ]
|
|
||||||
2024/05/23-11:25:01.375332 7f803fe006c0 Delete type=2 #5
|
|
||||||
2024/05/23-11:25:01.375618 7f803fe006c0 Delete type=2 #105
|
|
||||||
2024/05/23-11:25:01.397027 7f803fe006c0 Manual compaction at level-1 from '!items!zfpjROW9LDAlXUkN' @ 126 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2024/04/24-21:03:14.357785 7fcc5fe006c0 Recovering log #96
|
2026/01/10-16:36:53.884816 7fd463fff6c0 Recovering log #302
|
||||||
2024/04/24-21:03:14.368372 7fcc5fe006c0 Delete type=3 #94
|
2026/01/10-16:36:53.895475 7fd463fff6c0 Delete type=3 #300
|
||||||
2024/04/24-21:03:14.368475 7fcc5fe006c0 Delete type=0 #96
|
2026/01/10-16:36:53.895553 7fd463fff6c0 Delete type=0 #302
|
||||||
2024/04/24-21:12:06.730451 7fcc5e4006c0 Level-0 table #101: started
|
2026/01/10-17:13:09.459290 7fd4627fc6c0 Level-0 table #307: started
|
||||||
2024/04/24-21:12:06.730536 7fcc5e4006c0 Level-0 table #101: 0 bytes OK
|
2026/01/10-17:13:09.459318 7fd4627fc6c0 Level-0 table #307: 0 bytes OK
|
||||||
2024/04/24-21:12:06.737283 7fcc5e4006c0 Delete type=0 #99
|
2026/01/10-17:13:09.465368 7fd4627fc6c0 Delete type=0 #305
|
||||||
2024/04/24-21:12:06.745838 7fcc5e4006c0 Manual compaction at level-0 from '!items!0EAAt0qSzcD9VRBH' @ 72057594037927935 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.465682 7fd4627fc6c0 Manual compaction at level-0 from '!items!0EAAt0qSzcD9VRBH' @ 72057594037927935 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at (end)
|
||||||
2024/04/24-21:12:06.752158 7fcc5e4006c0 Manual compaction at level-1 from '!items!0EAAt0qSzcD9VRBH' @ 72057594037927935 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.465759 7fd4627fc6c0 Manual compaction at level-1 from '!items!0EAAt0qSzcD9VRBH' @ 72057594037927935 : 1 .. '!items!zfpjROW9LDAlXUkN' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
BIN
packs/avantages/MANIFEST-000308
Normal file
BIN
packs/avantages/MANIFEST-000308
Normal file
Binary file not shown.
Binary file not shown.
BIN
packs/capacites/000179.ldb
Normal file
BIN
packs/capacites/000179.ldb
Normal file
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000102
|
MANIFEST-000308
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
2024/05/23-10:57:45.594438 7f8046a006c0 Recovering log #100
|
2026/01/10-17:13:21.456371 7fd462ffd6c0 Recovering log #306
|
||||||
2024/05/23-10:57:45.605133 7f8046a006c0 Delete type=3 #98
|
2026/01/10-17:13:21.466637 7fd462ffd6c0 Delete type=3 #304
|
||||||
2024/05/23-10:57:45.605268 7f8046a006c0 Delete type=0 #100
|
2026/01/10-17:13:21.466715 7fd462ffd6c0 Delete type=0 #306
|
||||||
2024/05/23-11:25:01.333752 7f803fe006c0 Level-0 table #105: started
|
2026/01/10-22:35:10.912772 7fd4627fc6c0 Level-0 table #311: started
|
||||||
2024/05/23-11:25:01.337048 7f803fe006c0 Level-0 table #105: 24250 bytes OK
|
2026/01/10-22:35:10.912830 7fd4627fc6c0 Level-0 table #311: 0 bytes OK
|
||||||
2024/05/23-11:25:01.343059 7f803fe006c0 Delete type=0 #103
|
2026/01/10-22:35:10.918894 7fd4627fc6c0 Delete type=0 #309
|
||||||
2024/05/23-11:25:01.354655 7f803fe006c0 Manual compaction at level-0 from '!items!0cNSRJVPk3GbvxfD' @ 72057594037927935 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at (end)
|
2026/01/10-22:35:10.937977 7fd4627fc6c0 Manual compaction at level-0 from '!items!0cNSRJVPk3GbvxfD' @ 72057594037927935 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.375782 7f803fe006c0 Manual compaction at level-1 from '!items!0cNSRJVPk3GbvxfD' @ 72057594037927935 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at '!items!yWDg2KlXEz33TSmZ' @ 72 : 1
|
2026/01/10-22:35:10.938019 7fd4627fc6c0 Manual compaction at level-1 from '!items!0cNSRJVPk3GbvxfD' @ 72057594037927935 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at (end)
|
||||||
2024/05/23-11:25:01.375804 7f803fe006c0 Compacting 1@1 + 1@2 files
|
|
||||||
2024/05/23-11:25:01.379818 7f803fe006c0 Generated table #106@1: 36 keys, 24250 bytes
|
|
||||||
2024/05/23-11:25:01.379847 7f803fe006c0 Compacted 1@1 + 1@2 files => 24250 bytes
|
|
||||||
2024/05/23-11:25:01.386783 7f803fe006c0 compacted to: files[ 0 0 1 0 0 0 0 ]
|
|
||||||
2024/05/23-11:25:01.386889 7f803fe006c0 Delete type=2 #5
|
|
||||||
2024/05/23-11:25:01.387092 7f803fe006c0 Delete type=2 #105
|
|
||||||
2024/05/23-11:25:01.397039 7f803fe006c0 Manual compaction at level-1 from '!items!yWDg2KlXEz33TSmZ' @ 72 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at (end)
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2024/04/24-21:03:14.382877 7fcc5fe006c0 Recovering log #96
|
2026/01/10-16:36:53.922222 7fd4637fe6c0 Recovering log #302
|
||||||
2024/04/24-21:03:14.392582 7fcc5fe006c0 Delete type=3 #94
|
2026/01/10-16:36:53.933241 7fd4637fe6c0 Delete type=3 #300
|
||||||
2024/04/24-21:03:14.392719 7fcc5fe006c0 Delete type=0 #96
|
2026/01/10-16:36:53.933388 7fd4637fe6c0 Delete type=0 #302
|
||||||
2024/04/24-21:12:06.745861 7fcc5e4006c0 Level-0 table #101: started
|
2026/01/10-17:13:09.439054 7fd4627fc6c0 Level-0 table #307: started
|
||||||
2024/04/24-21:12:06.745883 7fcc5e4006c0 Level-0 table #101: 0 bytes OK
|
2026/01/10-17:13:09.439130 7fd4627fc6c0 Level-0 table #307: 0 bytes OK
|
||||||
2024/04/24-21:12:06.751942 7fcc5e4006c0 Delete type=0 #99
|
2026/01/10-17:13:09.445231 7fd4627fc6c0 Delete type=0 #305
|
||||||
2024/04/24-21:12:06.758963 7fcc5e4006c0 Manual compaction at level-0 from '!items!0cNSRJVPk3GbvxfD' @ 72057594037927935 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.465606 7fd4627fc6c0 Manual compaction at level-0 from '!items!0cNSRJVPk3GbvxfD' @ 72057594037927935 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at (end)
|
||||||
2024/04/24-21:12:06.766233 7fcc5e4006c0 Manual compaction at level-1 from '!items!0cNSRJVPk3GbvxfD' @ 72057594037927935 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at (end)
|
2026/01/10-17:13:09.465720 7fd4627fc6c0 Manual compaction at level-1 from '!items!0cNSRJVPk3GbvxfD' @ 72057594037927935 : 1 .. '!items!yWDg2KlXEz33TSmZ' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
BIN
packs/capacites/MANIFEST-000308
Normal file
BIN
packs/capacites/MANIFEST-000308
Normal file
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user