forked from public/foundryvtt-reve-de-dragon
Compare commits
2 Commits
f1b6c01cd7
...
v12
Author | SHA1 | Date | |
---|---|---|---|
da1719a336 | |||
78e30b5503 |
@ -1,8 +1,4 @@
|
|||||||
# 12.0
|
# 12.0
|
||||||
## 12.0.40 - Les mains d'Astrobazzarh
|
|
||||||
- correction des attaques particulières en combat
|
|
||||||
- correction de message sur les min/max liés aux modificateurs de races (s'applique uniquement sur la taille)
|
|
||||||
|
|
||||||
## 12.0.39 - Les mains d'Astrobazzarh
|
## 12.0.39 - Les mains d'Astrobazzarh
|
||||||
- les armes à 1 ou 2 mains fonctionnent dans les liens de jets de dés
|
- les armes à 1 ou 2 mains fonctionnent dans les liens de jets de dés
|
||||||
- commande `/jet` pour poster une demande de jet de dés
|
- commande `/jet` pour poster une demande de jet de dés
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
export { default as RdDItemBaseSheet} from "./common-item-sheet.mjs"
|
export { default as RdDItemSheet} from "./common-item-sheet.mjs"
|
||||||
export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs"
|
export { default as RdDMonnaieSheet } from "./monnaie-sheet.mjs"
|
||||||
|
export { default as RdDMunitionSheet } from "./munition-sheet.mjs"
|
||||||
|
@ -1,21 +1,9 @@
|
|||||||
const { HandlebarsApplicationMixin } = foundry.applications.api
|
const { HandlebarsApplicationMixin } = foundry.applications.api
|
||||||
import { SYSTEM_RDD } from "../../constants.js"
|
import { SYSTEM_RDD } from "../../constants.js"
|
||||||
import { Misc } from "../../misc.js"
|
import { Misc } from "../../misc.js"
|
||||||
import { RdDSheetUtility } from "../../rdd-sheet-utility.js";
|
|
||||||
|
|
||||||
|
export default class RdDItemSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
||||||
|
|
||||||
export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
|
||||||
|
|
||||||
static preloadHandlebars(...templatesList) {
|
|
||||||
const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"]
|
|
||||||
templatesList.forEach(templates =>
|
|
||||||
templates.forEach(t =>
|
|
||||||
t.handlebars().forEach(h => handlebars.push(h))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
loadTemplates(Misc.distinct(handlebars))
|
|
||||||
}
|
|
||||||
|
|
||||||
static register(sheetClass) {
|
static register(sheetClass) {
|
||||||
const itemType = sheetClass.ITEM_TYPE
|
const itemType = sheetClass.ITEM_TYPE
|
||||||
Items.registerSheet(SYSTEM_RDD, sheetClass, {
|
Items.registerSheet(SYSTEM_RDD, sheetClass, {
|
||||||
@ -24,30 +12,21 @@ export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry
|
|||||||
makeDefault: true
|
makeDefault: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
static registerAll(...sheetClasses) {
|
|
||||||
const handlebars = ["systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"]
|
|
||||||
sheetClasses.forEach(sheetClass => {
|
|
||||||
sheetClass.TEMPLATES.forEach(t =>
|
|
||||||
t.handlebars().forEach(h => handlebars.push(h))
|
|
||||||
)
|
|
||||||
const itemType = sheetClass.ITEM_TYPE
|
|
||||||
Items.registerSheet(SYSTEM_RDD, sheetClass, {
|
|
||||||
label: Misc.typeName('Item', itemType),
|
|
||||||
types: [itemType],
|
|
||||||
makeDefault: true
|
|
||||||
})
|
|
||||||
})
|
|
||||||
loadTemplates(Misc.distinct(handlebars))
|
|
||||||
}
|
|
||||||
|
|
||||||
static get ITEM_TYPE() { return undefined }
|
static get ITEM_TYPE() { return undefined }
|
||||||
|
/**
|
||||||
|
* Different sheet modes.
|
||||||
|
* @enum {number}
|
||||||
|
*/
|
||||||
|
static SHEET_MODES = { EDIT: 0, PLAY: 1 }
|
||||||
|
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
super(options)
|
super(options)
|
||||||
|
this.#dragDrop = this.#createDragDropHandlers()
|
||||||
}
|
}
|
||||||
|
|
||||||
static get TEMPLATES() { return [] }
|
#dragDrop
|
||||||
|
_sheetMode = this.constructor.SHEET_MODES.PLAY
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
@ -62,30 +41,140 @@ export default class RdDItemBaseSheet extends HandlebarsApplicationMixin(foundry
|
|||||||
window: {
|
window: {
|
||||||
resizable: true,
|
resizable: true,
|
||||||
},
|
},
|
||||||
|
dragDrop: [{ dragSelector: "[data-drag]", dropSelector: null }],
|
||||||
actions: {
|
actions: {
|
||||||
editImage: RdDItemBaseSheet.#onEditImage,
|
toggleSheet: RdDItemSheet.#onToggleSheet,
|
||||||
}
|
editImage: RdDItemSheet.#onEditImage,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the sheet currently in 'Play' mode?
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
get isPlayMode() {
|
||||||
|
return this._sheetMode === this.constructor.SHEET_MODES.PLAY
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the sheet currently in 'Edit' mode?
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
get isEditMode() {
|
||||||
|
return this._sheetMode === this.constructor.SHEET_MODES.EDIT
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
async _prepareContext() {
|
async _prepareContext() {
|
||||||
return {
|
const context = {
|
||||||
item: this.document,
|
|
||||||
options: RdDSheetUtility.getOptions(this.document, this.isEditable),
|
|
||||||
fields: this.document.schema.fields,
|
fields: this.document.schema.fields,
|
||||||
systemFields: this.document.system.schema.fields,
|
systemFields: this.document.system.schema.fields,
|
||||||
|
item: this.document,
|
||||||
system: this.document.system,
|
system: this.document.system,
|
||||||
source: this.document.toObject(),
|
source: this.document.toObject(),
|
||||||
|
isEditMode: this.isEditMode,
|
||||||
|
isPlayMode: this.isPlayMode,
|
||||||
isEditable: this.isEditable,
|
isEditable: this.isEditable,
|
||||||
}
|
}
|
||||||
|
return context
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
_onRender(context, options) {
|
||||||
|
this.#dragDrop.forEach((d) => d.bind(this.element))
|
||||||
|
}
|
||||||
|
|
||||||
|
// #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 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 && this.document.isOwner
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback actions which occur at the beginning of a drag start workflow.
|
||||||
|
* @param {DragEvent} event The originating DragEvent
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_onDragStart(event) {
|
||||||
|
const el = event.currentTarget
|
||||||
|
if ("link" in event.target.dataset) return
|
||||||
|
|
||||||
|
// Extract the data you need
|
||||||
|
let dragData = null
|
||||||
|
|
||||||
|
if (!dragData) return
|
||||||
|
|
||||||
|
// Set data transfer
|
||||||
|
event.dataTransfer.setData("text/plain", JSON.stringify(dragData))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback actions which occur when a dragged element is over a drop target.
|
||||||
|
* @param {DragEvent} event The originating DragEvent
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
_onDragOver(event) { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback actions which occur when a dragged element is dropped on a target.
|
||||||
|
* @param {DragEvent} event The originating DragEvent
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
async _onDrop(event) { }
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
|
||||||
// #region Actions
|
// #region Actions
|
||||||
|
/**
|
||||||
|
* Handle toggling between Edit and Play mode.
|
||||||
|
* @param {Event} event The initiating click event.
|
||||||
|
* @param {HTMLElement} target The current target of the event listener.
|
||||||
|
*/
|
||||||
|
static #onToggleSheet(event, target) {
|
||||||
|
const modes = this.constructor.SHEET_MODES
|
||||||
|
this._sheetMode = this.isEditMode ? modes.PLAY : modes.EDIT
|
||||||
|
this.render()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle changing a Document's image.
|
* Handle changing a Document's image.
|
||||||
*
|
*
|
||||||
* @this RdDItemBaseSheet
|
* @this RdDItemSheet
|
||||||
* @param {PointerEvent} event The originating click event
|
* @param {PointerEvent} event The originating click event
|
||||||
* @param {HTMLElement} target The capturing HTML element which defined a [data-action]
|
* @param {HTMLElement} target The capturing HTML element which defined a [data-action]
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
|
@ -1,40 +1,35 @@
|
|||||||
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||||
import { ITEM_TYPES } from "../../constants.js";
|
import { ITEM_TYPES } from "../../constants.js";
|
||||||
import RdDItemBaseSheet from "./common-item-sheet.mjs";
|
import RdDItemSheet from "./common-item-sheet.mjs";
|
||||||
|
|
||||||
export default class RdDMonnaieSheet extends RdDItemBaseSheet {
|
|
||||||
|
|
||||||
|
export default class RdDMonnaieSheet extends RdDItemSheet {
|
||||||
/** @override */
|
/** @override */
|
||||||
static get ITEM_TYPE() { return ITEM_TYPES.monnaie }
|
static get ITEM_TYPE() { return ITEM_TYPES.monnaie }
|
||||||
static get TEMPLATES() { return [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE] }
|
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = Object.assign({},
|
static DEFAULT_OPTIONS = {
|
||||||
RdDItemBaseSheet.DEFAULT_OPTIONS,
|
classes: ["fvtt-rdd", "item", "monnaie"],
|
||||||
{
|
position: {
|
||||||
classes: ["fvtt-rdd", "item", "monnaie"],
|
width: 600,
|
||||||
position: {
|
},
|
||||||
width: 400,
|
window: {
|
||||||
},
|
contentClasses: ["monnaie-content"],
|
||||||
window: {
|
},
|
||||||
contentClasses: ["monnaie-content"],
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
main: {
|
main: {
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/sheets/item/monnaie.hbs",
|
template: "systems/foundryvtt-reve-de-dragon/templates/item/monnaie.hbs",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
async _prepareContext() {
|
async _prepareContext() {
|
||||||
return Object.assign(
|
const context = await super._prepareContext()
|
||||||
await super._prepareContext(),
|
return Object.assign(context,
|
||||||
await TEMPLATE_DESCRIPTION.prepareContext(this.document),
|
await TEMPLATE_DESCRIPTION.prepareContext(this.item),
|
||||||
await TEMPLATE_INVENTAIRE.prepareContext(this.document)
|
await TEMPLATE_INVENTAIRE.prepareContext(this.item)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
35
module/applications/sheets/munition-sheet.mjs
Normal file
35
module/applications/sheets/munition-sheet.mjs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../../common/_module.mjs";
|
||||||
|
import { ITEM_TYPES } from "../../constants.js";
|
||||||
|
import RdDItemSheet from "./common-item-sheet.mjs";
|
||||||
|
|
||||||
|
export default class RdDMunitionSheet extends RdDItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static get ITEM_TYPE() { return ITEM_TYPES.munition }
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
classes: ["fvtt-rdd", "item", "munition"],
|
||||||
|
position: {
|
||||||
|
width: 600,
|
||||||
|
},
|
||||||
|
window: {
|
||||||
|
contentClasses: ["munition-content"],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
main: {
|
||||||
|
template: "systems/foundryvtt-reve-de-dragon/templates/item/munition.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const context = await super._prepareContext()
|
||||||
|
return Object.assign(context,
|
||||||
|
await TEMPLATE_DESCRIPTION.prepareContext(this.item),
|
||||||
|
await TEMPLATE_INVENTAIRE.prepareContext(this.item)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -4,5 +4,4 @@ import { CommonInventaire } from "./inventaire.mjs";
|
|||||||
export const TEMPLATE_DESCRIPTION = new CommonDescription()
|
export const TEMPLATE_DESCRIPTION = new CommonDescription()
|
||||||
export const TEMPLATE_INVENTAIRE = new CommonInventaire()
|
export const TEMPLATE_INVENTAIRE = new CommonInventaire()
|
||||||
|
|
||||||
export const ALL_COMMON_TEMPLATES = [TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE]
|
|
||||||
|
|
||||||
|
@ -4,7 +4,5 @@
|
|||||||
*/
|
*/
|
||||||
export default class CommonTemplate {
|
export default class CommonTemplate {
|
||||||
fields() { }
|
fields() { }
|
||||||
handlebars() { return [] }
|
|
||||||
actions() { return {} }
|
|
||||||
async prepareContext(item) { }
|
async prepareContext(item) { }
|
||||||
}
|
}
|
@ -12,21 +12,11 @@ export class CommonDescription extends CommonTemplate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handlebars() {
|
|
||||||
return [
|
|
||||||
"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
actions() {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
|
|
||||||
async prepareContext(item) {
|
async prepareContext(item) {
|
||||||
const enriched = {
|
return {
|
||||||
description: await RdDTextEditor.enrichHTML(item.system.description, item),
|
description: await RdDTextEditor.enrichHTML(item.system.description, item),
|
||||||
descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item),
|
descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item),
|
||||||
}
|
}
|
||||||
return { enriched }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ export const DECIMAL = { required: true, nullable: false, min: 0, integer: false
|
|||||||
export const INTEGER_SIGNED = { required: true, nullable: false, integer: true }
|
export const INTEGER_SIGNED = { required: true, nullable: false, integer: true }
|
||||||
export const DECIMAL_SIGNED = { required: true, nullable: false, integer: false }
|
export const DECIMAL_SIGNED = { required: true, nullable: false, integer: false }
|
||||||
export const STRING = { required: true, nullable: false, blank: true, trim: true }
|
export const STRING = { required: true, nullable: false, blank: true, trim: true }
|
||||||
export const HTMLSTRING = { initial: "", required: true, nullable: false, blank: true, textSearch: true }
|
export const HTMLSTRING = { initial: "", required: true, nullable: false, blank: true, trim: false, textSearch: true }
|
||||||
|
|
||||||
export const MODEL_ARRAY = { initial: [], required: true, nullable: false }
|
export const MODEL_ARRAY = { initial: [], required: true, nullable: false }
|
||||||
|
|
||||||
|
@ -23,14 +23,6 @@ export class CommonInventaire extends CommonTemplate {
|
|||||||
{ label: "Environnement", ...MODEL_ARRAY }),
|
{ label: "Environnement", ...MODEL_ARRAY }),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handlebars() {
|
|
||||||
return [
|
|
||||||
"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
async prepareContext(item) {
|
async prepareContext(item) {
|
||||||
return {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
||||||
export { default as RdDModelMunition } from "./munition.mjs"
|
export { default as RdDModelMunition } from "./munition.mjs"
|
||||||
|
7
module/documents/munition.mjs
Normal file
7
module/documents/munition.mjs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { RdDItem } from "../item.js";
|
||||||
|
|
||||||
|
export default class RdDItemMunition extends RdDItem {
|
||||||
|
static get defaultIcon() {
|
||||||
|
return 'systems/foundryvtt-reve-de-dragon/icons/objets/fleche.webp'
|
||||||
|
}
|
||||||
|
}
|
@ -100,7 +100,7 @@ export class RdDItemSheetV1 extends ItemSheet {
|
|||||||
description: await RdDTextEditor.enrichHTML(this.item.system.description, this.item),
|
description: await RdDTextEditor.enrichHTML(this.item.system.description, this.item),
|
||||||
descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj, this.item),
|
descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj, this.item),
|
||||||
isComestible: this.item.getUtilisationCuisine(),
|
isComestible: this.item.getUtilisationCuisine(),
|
||||||
options: RdDSheetUtility.mergeDocumentRights({}, this.item, this.isEditable),
|
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
||||||
competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage),
|
competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage),
|
||||||
categories: RdDItem.getCategories(this.item.type),
|
categories: RdDItem.getCategories(this.item.type),
|
||||||
}
|
}
|
||||||
|
@ -1 +1,2 @@
|
|||||||
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
export { default as RdDModelMonnaie } from "./monnaie.mjs"
|
||||||
|
export { default as RdDModelMunition } from "./munition.mjs"
|
||||||
|
10
module/models/munition.mjs
Normal file
10
module/models/munition.mjs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs";
|
||||||
|
|
||||||
|
export default class RdDModelMunition extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
return Object.assign({},
|
||||||
|
TEMPLATE_DESCRIPTION.fields(),
|
||||||
|
TEMPLATE_INVENTAIRE.fields()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -776,7 +776,7 @@ export class RdDCombat {
|
|||||||
|
|
||||||
if (this.attacker.isCreatureEntite()) {
|
if (this.attacker.isCreatureEntite()) {
|
||||||
RdDItemCompetenceCreature.setRollDataCreature(rollData);
|
RdDItemCompetenceCreature.setRollDataCreature(rollData);
|
||||||
}
|
}
|
||||||
else if (arme) {
|
else if (arme) {
|
||||||
// Usual competence
|
// Usual competence
|
||||||
rollData.arme = RdDItemArme.armeUneOuDeuxMains(arme, RdDItemCompetence.isArmeUneMain(competence));
|
rollData.arme = RdDItemArme.armeUneOuDeuxMains(arme, RdDItemCompetence.isArmeUneMain(competence));
|
||||||
@ -832,10 +832,7 @@ export class RdDCombat {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onAttaqueNormale(attackerRoll) {
|
async _onAttaqueNormale(attackerRoll) {
|
||||||
if (!RdDCombat.isReussite(attackerRoll)) {
|
if (!RdDCombat.isReussite(attackerRoll) || RdDCombat.isParticuliere(attackerRoll)) {
|
||||||
return
|
|
||||||
}
|
|
||||||
if (RdDCombat.isParticuliere(attackerRoll) && attackerRoll.particuliere == undefined) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log("RdDCombat.onAttaqueNormale >>>", attackerRoll);
|
console.log("RdDCombat.onAttaqueNormale >>>", attackerRoll);
|
||||||
@ -852,7 +849,7 @@ export class RdDCombat {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.defender) {
|
if (this.target) {
|
||||||
await this._sendMessageDefense(attackerRoll, defenderRoll);
|
await this._sendMessageDefense(attackerRoll, defenderRoll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1002,7 +999,7 @@ export class RdDCombat {
|
|||||||
|
|
||||||
this.removeChatMessageActionsPasseArme(rollData.passeArme);
|
this.removeChatMessageActionsPasseArme(rollData.passeArme);
|
||||||
rollData.particuliere = choix;
|
rollData.particuliere = choix;
|
||||||
await this._onAttaqueNormale(rollData)
|
await this._onAttaqueNormale(rollData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -105,6 +105,7 @@ export class SystemReveDeDragon {
|
|||||||
this.RdDStatBlockParser = RdDStatBlockParser
|
this.RdDStatBlockParser = RdDStatBlockParser
|
||||||
this.itemClasses = {
|
this.itemClasses = {
|
||||||
monnaie: items.RdDModelMonnaie,
|
monnaie: items.RdDModelMonnaie,
|
||||||
|
munition: items.RdDModelMunition,
|
||||||
armure: RdDItemArmure,
|
armure: RdDItemArmure,
|
||||||
blessure: RdDItemBlessure,
|
blessure: RdDItemBlessure,
|
||||||
gemme: RdDItemGemme,
|
gemme: RdDItemGemme,
|
||||||
@ -185,6 +186,7 @@ export class SystemReveDeDragon {
|
|||||||
CONFIG.Item.documentClass = RdDItem
|
CONFIG.Item.documentClass = RdDItem
|
||||||
CONFIG.Item.dataModels = {
|
CONFIG.Item.dataModels = {
|
||||||
monnaie: models.RdDModelMonnaie,
|
monnaie: models.RdDModelMonnaie,
|
||||||
|
munition: models.RdDModelMunition,
|
||||||
}
|
}
|
||||||
CONFIG.RDD = {
|
CONFIG.RDD = {
|
||||||
resolutionTable: RdDResolutionTable.resolutionTable,
|
resolutionTable: RdDResolutionTable.resolutionTable,
|
||||||
@ -206,17 +208,14 @@ export class SystemReveDeDragon {
|
|||||||
|
|
||||||
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
||||||
types: [
|
types: [
|
||||||
"objet", "arme", "armure", "livre", "munition", "nourritureboisson",
|
"objet", "arme", "armure", "livre", "nourritureboisson",
|
||||||
],
|
],
|
||||||
makeDefault: true
|
makeDefault: true
|
||||||
})
|
})
|
||||||
|
|
||||||
sheets.RdDItemBaseSheet.registerAll(
|
sheets.RdDItemSheet.register(sheets.RdDMonnaieSheet)
|
||||||
sheets.RdDMonnaieSheet
|
sheets.RdDItemSheet.register(sheets.RdDMunitionSheet)
|
||||||
)
|
|
||||||
|
|
||||||
// ,
|
|
||||||
// sheets.RdDMunitionSheet
|
|
||||||
Items.registerSheet(SYSTEM_RDD, RdDItemSheetV1, {
|
Items.registerSheet(SYSTEM_RDD, RdDItemSheetV1, {
|
||||||
types: [
|
types: [
|
||||||
"competence", "competencecreature",
|
"competence", "competencecreature",
|
||||||
|
@ -3,11 +3,11 @@ import { RdDItem } from "./item.js";
|
|||||||
|
|
||||||
export class RdDSheetUtility {
|
export class RdDSheetUtility {
|
||||||
|
|
||||||
static getOptions(document, editable) {
|
static mergeDocumentRights(options, document, editable) {
|
||||||
const userRightLevel = game.user.isGM
|
const userRightLevel = game.user.isGM
|
||||||
? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
|
? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
|
||||||
: document.getUserLevel(game.user);
|
: document.getUserLevel(game.user);
|
||||||
return {
|
let newOptions = {
|
||||||
isGM: game.user.isGM,
|
isGM: game.user.isGM,
|
||||||
isOwned: document.parent ? true : false,
|
isOwned: document.parent ? true : false,
|
||||||
editable: editable,
|
editable: editable,
|
||||||
@ -16,15 +16,10 @@ export class RdDSheetUtility {
|
|||||||
isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER,
|
isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER,
|
||||||
isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
|
isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static mergeDocumentRights(options, document, editable) {
|
|
||||||
const newOptions = RdDSheetUtility.getOptions(document, editable);
|
|
||||||
foundry.utils.mergeObject(options, newOptions);
|
foundry.utils.mergeObject(options, newOptions);
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static getItem(event, actor) {
|
static getItem(event, actor) {
|
||||||
return actor.items.get(RdDSheetUtility.getItemId(event))
|
return actor.items.get(RdDSheetUtility.getItemId(event))
|
||||||
}
|
}
|
||||||
|
@ -28,9 +28,6 @@
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
body {
|
|
||||||
--input-height: 1.4rem;
|
|
||||||
}
|
|
||||||
:root {
|
:root {
|
||||||
/* =================== 1. ACTOR SHEET FONT STYLES =========== */
|
/* =================== 1. ACTOR SHEET FONT STYLES =========== */
|
||||||
--window-header-title-font-family: CaslonAntique;
|
--window-header-title-font-family: CaslonAntique;
|
||||||
@ -734,36 +731,10 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
|||||||
.flex-grow-3 {
|
.flex-grow-3 {
|
||||||
flex-grow: 3;
|
flex-grow: 3;
|
||||||
}
|
}
|
||||||
fieldset {
|
|
||||||
border-style: groove;
|
.editor.prosemirror {
|
||||||
border-width: 0.1rem;
|
|
||||||
padding-inline: 0.2rem;
|
|
||||||
padding-block: 0.1rem;
|
|
||||||
margin-inline: 0.1rem;
|
|
||||||
margin-block: 0.1rem;
|
|
||||||
}
|
|
||||||
form.application.sheet.fvtt-rdd fieldset :is(label, input) {
|
|
||||||
font-family: CaslonAntique;
|
|
||||||
text-align: justify;
|
|
||||||
font-size: 1rem;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
}
|
|
||||||
form.application.sheet.fvtt-rdd div.form-group {
|
|
||||||
clear: both;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin: 0.1rem 0;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
form.application.sheet.fvtt-rdd .editor.prosemirror {
|
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
min-height: 5rem;
|
min-height: 20rem;
|
||||||
}
|
|
||||||
form.application.sheet.fvtt-rdd prose-mirror.prosemirror .editor-container {
|
|
||||||
min-height: 5rem;
|
|
||||||
height: fit-content;
|
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
.large-editor {
|
.large-editor {
|
||||||
border: 2;
|
border: 2;
|
||||||
@ -771,7 +742,6 @@ form.application.sheet.fvtt-rdd prose-mirror.prosemirror .editor-container {
|
|||||||
min-height: 12rem;
|
min-height: 12rem;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor {
|
.editor {
|
||||||
border: 2;
|
border: 2;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
@ -795,7 +765,6 @@ form.application.sheet.fvtt-rdd prose-mirror.prosemirror .editor-container {
|
|||||||
.foundryvtt-reve-de-dragon.sheet :is(.large-editor,.editor,.medium-editor,.small-editor){
|
.foundryvtt-reve-de-dragon.sheet :is(.large-editor,.editor,.medium-editor,.small-editor){
|
||||||
align-items: start;
|
align-items: start;
|
||||||
}
|
}
|
||||||
|
|
||||||
.foundryvtt-reve-de-dragon.sheet :is(.large-editor,.editor,.medium-editor,.small-editor) .editor.prosemirror{
|
.foundryvtt-reve-de-dragon.sheet :is(.large-editor,.editor,.medium-editor,.small-editor) .editor.prosemirror{
|
||||||
align-items: normal;
|
align-items: normal;
|
||||||
}
|
}
|
||||||
|
@ -750,9 +750,6 @@
|
|||||||
"inertie": 0,
|
"inertie": 0,
|
||||||
"enchantabilite": 0
|
"enchantabilite": 0
|
||||||
},
|
},
|
||||||
"munition": {
|
|
||||||
"templates": ["description", "inventaire"]
|
|
||||||
},
|
|
||||||
"nourritureboisson": {
|
"nourritureboisson": {
|
||||||
"templates": ["description", "inventaire", "comestible"],
|
"templates": ["description", "inventaire", "comestible"],
|
||||||
"cuisinier": "",
|
"cuisinier": "",
|
||||||
|
@ -2,22 +2,19 @@
|
|||||||
<h4 class="rdd-roll-part">{{alias}} réussit une attaque particulière!</strong></h4>
|
<h4 class="rdd-roll-part">{{alias}} réussit une attaque particulière!</strong></h4>
|
||||||
{{#if isForce}}
|
{{#if isForce}}
|
||||||
<br>
|
<br>
|
||||||
<a class="chat-card-button particuliere-attaque" data-mode="force" data-attackerId="{{attackerId}}"
|
<a class="chat-card-button particuliere-attaque" data-mode="force" data-attackerId="{{attackerId}}">
|
||||||
data-defenderTokenId="{{defenderToken.id}}" data-attackerTokenId="{{attackerToken.id}}">
|
|
||||||
Attaquer en Force
|
Attaquer en Force
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if isRapide}}
|
{{#if isRapide}}
|
||||||
<br>
|
<br>
|
||||||
<a class="chat-card-button particuliere-attaque" data-mode="rapidite" data-attackerId="{{attackerId}}"
|
<a class="chat-card-button particuliere-attaque" data-mode="rapidite" data-attackerId="{{attackerId}}">
|
||||||
data-defenderTokenId="{{defenderToken.id}}" data-attackerTokenId="{{attackerToken.id}}">
|
|
||||||
Attaquer en Rapidité
|
Attaquer en Rapidité
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if isFinesse}}
|
{{#if isFinesse}}
|
||||||
<br>
|
<br>
|
||||||
<a class="chat-card-button particuliere-attaque" data-mode="finesse" data-attackerId="{{attackerId}}"
|
<a class="chat-card-button particuliere-attaque" data-mode="finesse" data-attackerId="{{attackerId}}">
|
||||||
data-defenderTokenId="{{defenderToken.id}}" data-attackerTokenId="{{attackerToken.id}}">
|
|
||||||
Attaquer en Finesse
|
Attaquer en Finesse
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
14
templates/item/monnaie.hbs
Normal file
14
templates/item/monnaie.hbs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<form class="{{cssClass}}" autocomplete="off">
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.hbs"}}
|
||||||
|
<nav class="sheet-tabs tabs" data-group="primary">
|
||||||
|
<a class="item" data-tab="informations">Informations</a>
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-tab-environnement.hbs"}}
|
||||||
|
</nav>
|
||||||
|
<section class="sheet-body">
|
||||||
|
<div class="tab items flexcol" data-group="primary" data-tab="informations">
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.hbs"}}
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.hbs"}}
|
||||||
|
</div>
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.hbs"}}
|
||||||
|
</section>
|
||||||
|
</form>
|
14
templates/item/munition.hbs
Normal file
14
templates/item/munition.hbs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<form class="{{cssClass}}" autocomplete="off">
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.hbs"}}
|
||||||
|
<nav class="sheet-tabs tabs" data-group="primary">
|
||||||
|
<a class="item" data-tab="informations">Informations</a>
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-tab-environnement.hbs"}}
|
||||||
|
</nav>
|
||||||
|
<section class="sheet-body">
|
||||||
|
<div class="tab items flexcol" data-group="primary" data-tab="informations">
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.hbs"}}
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.hbs"}}
|
||||||
|
</div>
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-environnement.hbs"}}
|
||||||
|
</section>
|
||||||
|
</form>
|
@ -1,6 +0,0 @@
|
|||||||
<header class="sheet-header">
|
|
||||||
<img class="profile-img" src="{{item.img}}" data-edit="img" data-tooltip="{{item.name}}"/>
|
|
||||||
<div class="header-fields">
|
|
||||||
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
@ -1,21 +0,0 @@
|
|||||||
<fieldset>
|
|
||||||
<div>
|
|
||||||
<label>Description :</label>
|
|
||||||
{{formInput
|
|
||||||
systemFields.description
|
|
||||||
enriched=enriched.description
|
|
||||||
value=system.description
|
|
||||||
name="system.description"
|
|
||||||
toggled=true}}
|
|
||||||
</div>
|
|
||||||
{{#if options.isGM}}
|
|
||||||
<div>
|
|
||||||
<label>Description (MJ seulement):</label>
|
|
||||||
{{formInput
|
|
||||||
systemFields.descriptionmj
|
|
||||||
enriched=enriched.descriptionmj
|
|
||||||
value=system.descriptionmj
|
|
||||||
name="system.descriptionmj" toggled=true}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
</fieldset>
|
|
@ -1,6 +0,0 @@
|
|||||||
<fieldset>
|
|
||||||
{{formField systemFields.qualite value=system.qualite}}
|
|
||||||
{{formField systemFields.encombrement value=system.encombrement}}
|
|
||||||
{{formField systemFields.quantite value=system.quantite}}
|
|
||||||
{{formField systemFields.cout value=system.cout}}
|
|
||||||
</fieldset>
|
|
@ -1,6 +0,0 @@
|
|||||||
<section>
|
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/header.hbs"}}
|
|
||||||
|
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"}}
|
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs"}}
|
|
||||||
</section>
|
|
Reference in New Issue
Block a user