Actor sheet, step 1
This commit is contained in:
@@ -9,3 +9,5 @@ export { default as HellbornSpeciesTraitSheet } from "./sheets/species-trait-she
|
||||
export { default as HellbornPerkSheet } from "./sheets/perk-sheet.mjs"
|
||||
export { default as HellbornMaleficaSheet } from "./sheets/malefica-sheet.mjs"
|
||||
export { default as HellbornArmorSheet } from "./sheets/armor-sheet.mjs"
|
||||
export { default as HellbornTarotSheet } from "./sheets/tarot-sheet.mjs"
|
||||
export { default as HellbornDealSheet } from "./sheets/deal-sheet.mjs"
|
||||
|
||||
@@ -66,8 +66,7 @@ export default class HellbornActorSheet extends HandlebarsApplicationMixin(found
|
||||
actor: this.document,
|
||||
system: this.document.system,
|
||||
source: this.document.toObject(),
|
||||
isEncumbered: this.document.system.isEncumbered(),
|
||||
enrichedDescription: await TextEditor.enrichHTML(this.document.system.description, { async: true }),
|
||||
enrichedBackstory: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.backstory, { async: true }),
|
||||
isEditMode: this.isEditMode,
|
||||
isPlayMode: this.isPlayMode,
|
||||
isEditable: this.isEditable,
|
||||
@@ -99,7 +98,7 @@ export default class HellbornActorSheet extends HandlebarsApplicationMixin(found
|
||||
dragover: this._onDragOver.bind(this),
|
||||
drop: this._onDrop.bind(this),
|
||||
}
|
||||
return new DragDrop(d)
|
||||
return new foundry.applications.ux.DragDrop.implementation(d)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,9 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
createEquipment: HellbornCharacterSheet.#onCreateEquipment,
|
||||
createArmor: HellbornCharacterSheet.#onCreateArmor,
|
||||
createWeapon: HellbornCharacterSheet.#onCreateWeapon,
|
||||
createTalent: HellbornCharacterSheet.#onCreateTalent,
|
||||
createImplant: HellbornCharacterSheet.#onCreateImplant,
|
||||
createPsionic: HellbornCharacterSheet.#onCreatePsionic,
|
||||
createLanguage: HellbornCharacterSheet.#onCreateLanguage
|
||||
|
||||
createDeal: HellbornCharacterSheet.#onCreateDeal,
|
||||
createMalefica: HellbornCharacterSheet.#onCreateMalefica,
|
||||
createRitual: HellbornCharacterSheet.#onCreateRitual,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -31,8 +29,11 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
tabs: {
|
||||
template: "templates/generic/tab-navigation.hbs",
|
||||
},
|
||||
talents: {
|
||||
template: "systems/fvtt-hellborn/templates/character-talents.hbs",
|
||||
status: {
|
||||
template: "systems/fvtt-hellborn/templates/character-status.hbs",
|
||||
},
|
||||
maleficas: {
|
||||
template: "systems/fvtt-hellborn/templates/character-maleficas.hbs",
|
||||
},
|
||||
equipment: {
|
||||
template: "systems/fvtt-hellborn/templates/character-equipment.hbs",
|
||||
@@ -44,7 +45,7 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
|
||||
/** @override */
|
||||
tabGroups = {
|
||||
sheet: "talents",
|
||||
sheet: "status",
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +54,8 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
*/
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
talents: { id: "talents", group: "sheet", icon: "fa-solid fa-compass", label: "HELLBORN.Label.talents" },
|
||||
status: { id: "status", group: "sheet", icon: "fa-solid fa-compass", label: "HELLBORN.Label.status" },
|
||||
maleficas: { id: "maleficas", group: "sheet", icon: "fa-solid fa-compass", label: "HELLBORN.Label.maleficas" },
|
||||
equipment: { id: "equipment", group: "sheet", icon: "fa-solid fa-shapes", label: "HELLBORN.Label.equipment" },
|
||||
biography: { id: "biography", group: "sheet", icon: "fa-solid fa-book", label: "HELLBORN.Label.biography" },
|
||||
}
|
||||
@@ -69,28 +71,27 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||
context.enrichedNotes = await TextEditor.enrichHTML(this.document.system.notes, { async: true })
|
||||
|
||||
return context
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _preparePartContext(partId, context) {
|
||||
const doc = this.document
|
||||
context.systemFields = this.document.system.schema.fields
|
||||
switch (partId) {
|
||||
case "main":
|
||||
break
|
||||
case "talents":
|
||||
context.tab = context.tabs.talents
|
||||
context.talents = doc.itemTypes.talent
|
||||
context.talents.sort((a, b) => a.name.localeCompare(b.name))
|
||||
context.implants = doc.itemTypes.implant
|
||||
context.implants.sort((a, b) => a.name.localeCompare(b.name))
|
||||
context.psionics = doc.itemTypes.psionic
|
||||
context.psionics.sort((a, b) => a.name.localeCompare(b.name))
|
||||
context.languages = doc.itemTypes.language
|
||||
context.languages.sort((a, b) => a.name.localeCompare(b.name))
|
||||
case "status":
|
||||
context.tab = context.tabs.status
|
||||
context.perks = doc.itemTypes.perk
|
||||
context.perks.sort((a, b) => a.name.localeCompare(b.name))
|
||||
break;
|
||||
case "maleficas":
|
||||
context.tab = context.tabs.maleficas
|
||||
context.maleficas = doc.itemTypes.malefica
|
||||
context.maleficas.sort((a, b) => a.name.localeCompare(b.name))
|
||||
context.rituals = doc.itemTypes.ritual
|
||||
context.rituals.sort((a, b) => a.name.localeCompare(b.name))
|
||||
break
|
||||
case "equipment":
|
||||
context.tab = context.tabs.equipment
|
||||
@@ -103,8 +104,21 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
break
|
||||
case "biography":
|
||||
context.tab = context.tabs.biography
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(doc.system.description, { async: true })
|
||||
context.enrichedNotes = await TextEditor.enrichHTML(doc.system.notes, { async: true })
|
||||
context.deals = doc.itemTypes.deal
|
||||
context.deals.sort((a, b) => a.name.localeCompare(b.name))
|
||||
context.tarot = doc.itemTypes.tarot
|
||||
context.enrichedBackstory = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.backstory, { async: true })
|
||||
context.enrichedAppearance = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.appearance, { async: true })
|
||||
context.enrichedScars = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.scars, { async: true })
|
||||
context.enrichedLikes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.likes, { async: true })
|
||||
context.enrichedDislikes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.dislikes, { async: true })
|
||||
context.enrichedFears = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.fears, { async: true })
|
||||
context.enrichedVices = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.vices, { async: true })
|
||||
context.enrichedGoals = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.goals, { async: true })
|
||||
context.enrichedAmbitions = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.ambitions, { async: true })
|
||||
context.enrichedValues = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.values, { async: true })
|
||||
context.enrichedBonds = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.bonds, { async: true })
|
||||
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.notes, { async: true })
|
||||
break
|
||||
}
|
||||
return context
|
||||
@@ -115,6 +129,18 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newEquipment"), type: "equipment" }])
|
||||
}
|
||||
|
||||
static #onCreateDeal(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newDeal"), type: "deal" }])
|
||||
}
|
||||
|
||||
static #onCreateMalefica(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newMalefica"), type: "malefica" }])
|
||||
}
|
||||
|
||||
static #onCreateRitual(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newRitual"), type: "ritual" }])
|
||||
}
|
||||
|
||||
static #onCreateWeapon(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newWeapon"), type: "weapon" }])
|
||||
}
|
||||
@@ -123,21 +149,6 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newArmor"), type: "armor" }])
|
||||
}
|
||||
|
||||
static #onCreateTalent(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newTalent"), type: "talent" }])
|
||||
}
|
||||
|
||||
static #onCreateImplant(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newImplant"), type: "implant" }])
|
||||
}
|
||||
|
||||
static #onCreatePsionic(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newPsionic"), type: "psionic" }])
|
||||
}
|
||||
|
||||
static #onCreateLanguage(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("HELLBORN.Label.newLanguage"), type: "language" }])
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -158,10 +169,11 @@ export default class HellbornCharacterSheet extends HellbornActorSheet {
|
||||
const rollType = $(event.currentTarget).data("roll-type")
|
||||
let item
|
||||
let li
|
||||
let statKey
|
||||
switch (rollType) {
|
||||
case "skill":
|
||||
let skillId = $(event.currentTarget).data("skill-id");
|
||||
item = this.actor.system.skills[skillId];
|
||||
case "stat":
|
||||
statKey = $(event.currentTarget).data("stat-id");
|
||||
item = this.actor.system.stats[statKey];
|
||||
break
|
||||
case "weapon":
|
||||
case "damage":
|
||||
|
||||
28
module/applications/sheets/deal-sheet.mjs
Normal file
28
module/applications/sheets/deal-sheet.mjs
Normal file
@@ -0,0 +1,28 @@
|
||||
import HellbornItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class HellbornDealSheet extends HellbornItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["deal"],
|
||||
position: {
|
||||
width: 600,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["deal-content"],
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-hellborn/templates/deal.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||
return context
|
||||
}
|
||||
}
|
||||
30
module/applications/sheets/tarot-sheet.mjs
Normal file
30
module/applications/sheets/tarot-sheet.mjs
Normal file
@@ -0,0 +1,30 @@
|
||||
import HellbornItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class HellbornTarotSheet extends HellbornItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["tarot"],
|
||||
position: {
|
||||
width: 800,
|
||||
height: 640
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["tarot-content"],
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-hellborn/templates/tarot.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedPositiveEffect = await TextEditor.enrichHTML(this.document.system.positiveEffect, { async: true })
|
||||
context.enrichedNegativeEffect = await TextEditor.enrichHTML(this.document.system.negativeEffect, { async: true })
|
||||
return context
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,30 @@ export const ASCII = `
|
||||
|
||||
`
|
||||
|
||||
export const AILMENTS = {
|
||||
"bleeding": { id: "bleeding", label: "Bleeding" },
|
||||
"blinded": { id: "blinded", label: "Blinded" },
|
||||
"burning": { id: "burning", label: "Burning" },
|
||||
"dazed": { id: "dazed", label: "Dazed" },
|
||||
"deafened": { id: "deafened", label: "Deafened" },
|
||||
"exposes": { id: "exposed", label: "Exposed" },
|
||||
"mortally": { id: "mortal", label: "Mortal" },
|
||||
"muted": { id: "muted", label: "Muted" },
|
||||
"prone": { id: "prone", label: "Prone" },
|
||||
"immobilized": { id: "immobilized", label: "Immobile" },
|
||||
"shaken": { id: "shaken", label: "Shaken" },
|
||||
"stunned": { id: "stunned", label: "Stunned" },
|
||||
"winded": { id: "winded", label: "Winded" }
|
||||
}
|
||||
|
||||
export const STATS = {
|
||||
"flesh": { id: "flesh", label: "Flesh" },
|
||||
"skin": { id: "skin", label: "Skin" },
|
||||
"heart": { id: "heart", label: "Heart" },
|
||||
"mind": { id: "mind", label: "Mind" },
|
||||
"soul": { id: "soul", label: "Soul" }
|
||||
}
|
||||
|
||||
export const PERK_ROLES = {
|
||||
"abbetor": { id: "abbetor", label: "Abbetor" },
|
||||
"blade": { id: "blade", label: "Blade" },
|
||||
@@ -68,47 +92,6 @@ export const ATTACK_MODIFIERS = {
|
||||
"aware": -1
|
||||
}
|
||||
|
||||
export const TRIAGE_RESULTS = {
|
||||
"none": { id: "none", dice:0, label: "HELLBORN.TriageResults.None" },
|
||||
"death": { id: "death", dice:3, label: "HELLBORN.TriageResults.Death" },
|
||||
"critical": { id: "critical", dice:4, label: "HELLBORN.TriageResults.Critical" },
|
||||
"severe": { id: "severe", dice:7, label: "HELLBORN.TriageResults.Severe" },
|
||||
"moderate": { id: "moderate", dice:10, label: "HELLBORN.TriageResults.Moderate" },
|
||||
"fleshwound": { id: "fleshwound", dice:12, label: "HELLBORN.TriageResults.FleshWound" }
|
||||
}
|
||||
|
||||
export const CREATURE_TERRAIN_TYPES = {
|
||||
"cave": { id: "cave", label: "HELLBORN.Creature.Terrain.Cave", niche:0, size: 0 },
|
||||
"coast": { id: "coast", label: "HELLBORN.Creature.Terrain.Coast", niche:1, size: 0 },
|
||||
"desert": { id: "desert", label: "HELLBORN.Creature.Terrain.Desert", niche:-1, size: -1 },
|
||||
"forest": { id: "forest", label: "HELLBORN.Creature.Terrain.Forest", niche:1, size: 1 },
|
||||
"jungle": { id: "jungle", label: "HELLBORN.Creature.Terrain.Jungle", niche:1, size: 1 },
|
||||
"mixed": { id: "mixed", label: "HELLBORN.Creature.Terrain.Mixed", niche:0, size: 0 },
|
||||
"mountain": { id: "mountain", label: "HELLBORN.Creature.Terrain.Mountain", niche:-1, size: -1 },
|
||||
"ocean": { id: "ocean", label: "HELLBORN.Creature.Terrain.Ocean", niche:-1, size: 1 },
|
||||
"river": { id: "river", label: "HELLBORN.Creature.Terrain.River", niche:1, size: 0 },
|
||||
"ruins": { id: "ruins", label: "HELLBORN.Creature.Terrain.Ruins", niche:0, size: 1 },
|
||||
"savannah": { id: "savannah", label: "HELLBORN.Creature.Terrain.Savannah", niche:0, size: 1 },
|
||||
"shallows": { id: "shallows", label: "HELLBORN.Creature.Terrain.Shallows", niche:1, size: 0 },
|
||||
"swamp": { id: "swamp", label: "HELLBORN.Creature.Terrain.Swamp", niche:1, size: 1 }
|
||||
}
|
||||
|
||||
export const CREATURE_NICHES = {
|
||||
"prey": { id: "prey", label: "HELLBORN.Creature.Niche.Prey" },
|
||||
"opportunist": { id: "opportunist", label: "HELLBORN.Creature.Niche.Opportunist" },
|
||||
"herbivore": { id: "herbivore", label: "HELLBORN.Creature.Niche.Herbivore" },
|
||||
"predator": { id: "predator", label: "HELLBORN.Creature.Niche.Predator" }
|
||||
}
|
||||
|
||||
export const CREATURE_SIZES = {
|
||||
"tiny": { id: "tiny", label: "HELLBORN.Creature.Size.Tiny" },
|
||||
"small": { id: "small", label: "HELLBORN.Creature.Size.Small" },
|
||||
"medium": { id: "medium", label: "HELLBORN.Creature.Size.Medium" },
|
||||
"large": { id: "large", label: "HELLBORN.Creature.Size.Large" },
|
||||
"giant": { id: "giant", label: "HELLBORN.Creature.Size.Giant" },
|
||||
"titanic": { id: "titanic", label: "HELLBORN.Creature.Size.Titanic" }
|
||||
}
|
||||
|
||||
export const MODIFIER_CHOICES = {
|
||||
"easy": { id: "easy", label: "HELLBORN.Label.Easy", value :"1" },
|
||||
"moderate": { id: "moderate", label: "HELLBORN.Label.Moderate", value: "0" },
|
||||
@@ -117,24 +100,14 @@ export const MODIFIER_CHOICES = {
|
||||
"impossible": { id: "impossible", label: "HELLBORN.Label.Impossible", value: "-4" }
|
||||
}
|
||||
|
||||
export const STARSHIP_HULL = {
|
||||
"pod": { id: "pod", label: "HELLBORN.Starship.Hull.Pod" },
|
||||
"micro": { id: "micro", label: "HELLBORN.Starship.Hull.Micro" },
|
||||
"small": { id: "small", label: "HELLBORN.Starship.Hull.Small" },
|
||||
"scout": { id: "scout", label: "HELLBORN.Starship.Hull.Scout" },
|
||||
"picket": { id: "picket", label: "HELLBORN.Starship.Hull.Picket" },
|
||||
"destroyer": { id: "destroyer", label: "HELLBORN.Starship.Hull.Destroyer" },
|
||||
"cruiser": { id: "cruiser", label: "HELLBORN.Starship.Hull.Cruiser" },
|
||||
"battleship": { id: "battleship", label: "HELLBORN.Starship.Hull.Battleship" },
|
||||
"carrier": { id: "carrier", label: "HELLBORN.Starship.Hull.Carrier" }
|
||||
}
|
||||
|
||||
/**
|
||||
* Include all constant definitions within the SYSTEM global export
|
||||
* @type {Object}
|
||||
*/
|
||||
export const SYSTEM = {
|
||||
id: SYSTEM_ID,
|
||||
AILMENTS,
|
||||
STATS,
|
||||
PERK_ROLES,
|
||||
PERK_LEVELS,
|
||||
MALEFICA_LEVELS,
|
||||
@@ -143,10 +116,5 @@ export const SYSTEM = {
|
||||
ATTACK_MODIFIERS,
|
||||
WEAPON_TYPES,
|
||||
RANGED_SUBTYPES,
|
||||
TRIAGE_RESULTS,
|
||||
CREATURE_TERRAIN_TYPES,
|
||||
CREATURE_SIZES,
|
||||
CREATURE_NICHES,
|
||||
STARSHIP_HULL,
|
||||
ASCII
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ export const defaultItemImg = {
|
||||
perk: "systems/fvtt-hellborn/assets/icons/perk.webp",
|
||||
"species-trait": "systems/fvtt-hellborn/assets/icons/species-trait.webp",
|
||||
armor: "systems/fvtt-hellborn/assets/icons/armor.webp",
|
||||
deal: "systems/fvtt-hellborn/assets/icons/deal.webp",
|
||||
tarot: "systems/fvtt-hellborn/assets/icons/tarot.webp",
|
||||
}
|
||||
|
||||
export default class HellbornItem extends Item {
|
||||
|
||||
@@ -8,3 +8,5 @@ export { default as HellbornMalefica } from "./malefica.mjs"
|
||||
export { default as HellbornSpeciesTrait } from "./species-trait.mjs"
|
||||
export { default as HellbornWeapon } from "./weapon.mjs"
|
||||
export { default as HellbornArmor } from "./armor.mjs"
|
||||
export { default as HellbornTarot } from "./tarot.mjs"
|
||||
export { default as HellbornDeal } from "./deal.mjs"
|
||||
|
||||
@@ -7,51 +7,100 @@ export default class HellbornActor extends foundry.abstract.TypeDataModel {
|
||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||
const schema = {}
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
// Ailments
|
||||
const ailmentField = (label) => {
|
||||
const schema = {
|
||||
enabled: new fields.BooleanField({ required: true, initial: false }),
|
||||
label: new fields.StringField({ required: true, initial: label })
|
||||
}
|
||||
return new fields.SchemaField(schema, { label })
|
||||
}
|
||||
schema.ailments = new fields.SchemaField(
|
||||
Object.values(SYSTEM.AILMENTS).reduce((obj, ailment) => {
|
||||
obj[ailment.id] = ailmentField(ailment.label)
|
||||
return obj
|
||||
}, {}),
|
||||
)
|
||||
|
||||
// Stats
|
||||
const statField = (label) => {
|
||||
const schema = {
|
||||
label: new fields.StringField({ required: true, initial: label }),
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
|
||||
}
|
||||
return new fields.SchemaField(schema, { label })
|
||||
}
|
||||
schema.stats = new fields.SchemaField(
|
||||
Object.values(SYSTEM.STATS).reduce((obj, stat) => {
|
||||
obj[stat.id] = statField(stat.label)
|
||||
return obj
|
||||
}, {}),
|
||||
)
|
||||
|
||||
schema.backstory = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.appearance = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.scars = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.likes = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.dislikes = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.fears = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.vices = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.goals = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.ambitions = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.values = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.bonds = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.notes = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.name = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
|
||||
schema.pronouns = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
schema.species = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
schema.trait = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
schema.upright = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
schema.reversed = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
|
||||
schema.heroPoints = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
|
||||
schema.health = new fields.SchemaField({
|
||||
staminaValue: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
staminaMax: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
wounds: new fields.NumberField({ ...requiredInteger, initial:0, min: 0 }),
|
||||
triageResults: new fields.StringField({ required: true, nullable: false, initial: "none", choices: SYSTEM.TRIAGE_RESULTS })
|
||||
schema.mortality = new fields.SchemaField({
|
||||
current: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
})
|
||||
|
||||
schema.enc = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.trauma = new fields.SchemaField({
|
||||
current: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
})
|
||||
|
||||
schema.armor = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.darkness = new fields.SchemaField({
|
||||
current: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
})
|
||||
|
||||
schema.credits = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.rank = new fields.SchemaField({
|
||||
experienced: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
|
||||
expert: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
|
||||
veteran: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
|
||||
elite: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
|
||||
legend: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 })
|
||||
schema.defense = new fields.SchemaField({
|
||||
base: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
bonus: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
total: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
resistance: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
})
|
||||
|
||||
schema.movement = new fields.SchemaField({
|
||||
base: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
reduce: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
})
|
||||
|
||||
schema.experience = new fields.SchemaField({
|
||||
training: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
current: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
total: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
})
|
||||
|
||||
schema.biodata = new fields.SchemaField({
|
||||
age: new fields.NumberField({ ...requiredInteger, initial: 15, min: 6 }),
|
||||
height: new fields.NumberField({ ...requiredInteger, initial: 170, min: 50 }),
|
||||
weight: new fields.NumberField({ ...requiredInteger, initial: 70, min: 1 }),
|
||||
gender: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
home: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
birthplace: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
eyes: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
hair: new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
home: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
weight: new fields.NumberField({ ...requiredInteger, initial: 70, min: 1 }),
|
||||
apparentAge: new fields.NumberField({ ...requiredInteger, initial: 20, min: 1 }),
|
||||
chronologicalAge: new fields.NumberField({ ...requiredInteger, initial: 20, min: 1 }),
|
||||
dod: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
soul: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
aliases: new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
})
|
||||
|
||||
return schema
|
||||
@@ -65,10 +114,6 @@ export default class HellbornActor extends foundry.abstract.TypeDataModel {
|
||||
|
||||
}
|
||||
|
||||
isEncumbered() {
|
||||
return this.enc.value > this.enc.max
|
||||
}
|
||||
|
||||
/** */
|
||||
/**
|
||||
* Rolls a dice for a character.
|
||||
|
||||
16
module/models/deal.mjs
Normal file
16
module/models/deal.mjs
Normal file
@@ -0,0 +1,16 @@
|
||||
import { SYSTEM } from "../config/system.mjs";
|
||||
|
||||
export default class HellbornDeal extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
schema.promisor = new fields.StringField({ required: true, initial: "" });
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
return schema;
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["HELLBORN.Deal"];
|
||||
}
|
||||
22
module/models/tarot.mjs
Normal file
22
module/models/tarot.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { SYSTEM } from "../config/system.mjs";
|
||||
|
||||
export default class HellbornTarot extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
schema.orientation = new fields.StringField({ required: true, initial: "Upright", choices: {"Upright": {label: "Upright"}, "Reversed": {label: "Reversed"}} });
|
||||
schema.positiveEffect = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.negativeEffect = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.image = new fields.FilePathField({
|
||||
required: false,
|
||||
categories: ["IMAGE"],
|
||||
default: "icons/svg/treasure.svg",
|
||||
})
|
||||
|
||||
return schema;
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["HELLBORN.Tarot"];
|
||||
}
|
||||
Reference in New Issue
Block a user