Add missing items/actors
This commit is contained in:
@@ -6,5 +6,9 @@ export { default as FTLNomadLanguageSheet } from "./sheets/language-sheet.mjs"
|
||||
export { default as FTLNomadTalentSheet } from "./sheets/talent-sheet.mjs"
|
||||
export { default as FTLNomadCharacterSheet } from "./sheets/character-sheet.mjs"
|
||||
export { default as FTLNomadEquipmentSheet } from "./sheets/equipment-sheet.mjs"
|
||||
export { default as FTLNomadNPCSheet } from "./sheets/npc-sheet.mjs"
|
||||
export { default as FTLNomadNPCSheet } from "./sheets/creature-sheet.mjs"
|
||||
export { default as FTLNomadImplantSheet } from "./sheets/implant-sheet.mjs"
|
||||
export { default as FTLNomadStarshipSheet } from "./sheets/starship-sheet.mjs"
|
||||
export { default as FTLNomadCreatureTraitSheet } from "./sheets/creature-trait-sheet.mjs"
|
||||
export { default as FTLNomadCreatureAbilitySheet } from "./sheets/creature-ability-sheet.mjs"
|
||||
|
||||
|
||||
28
module/applications/sheets/creature-ability-sheet.mjs
Normal file
28
module/applications/sheets/creature-ability-sheet.mjs
Normal file
@@ -0,0 +1,28 @@
|
||||
import FTLNomadItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class FTLNomadCreatureAbilitySheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["creature-ability"],
|
||||
position: {
|
||||
width: 600,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["creature-ability-content"],
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-ftl-nomad/templates/creature-ability.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||
return context
|
||||
}
|
||||
}
|
||||
28
module/applications/sheets/creature-trait-sheet.mjs
Normal file
28
module/applications/sheets/creature-trait-sheet.mjs
Normal file
@@ -0,0 +1,28 @@
|
||||
import FTLNomadItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class FTLNomadCreatureTraitSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["creature-trait"],
|
||||
position: {
|
||||
width: 600,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["creature-trait-content"],
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-ftl-nomad/templates/creature-trait.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||
return context
|
||||
}
|
||||
}
|
||||
27
module/applications/sheets/implant-sheet.mjs
Normal file
27
module/applications/sheets/implant-sheet.mjs
Normal file
@@ -0,0 +1,27 @@
|
||||
import FTLNomadItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class FTLNomadImplantSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["implant"],
|
||||
position: {
|
||||
width: 600,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["implant-content"],
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/implant.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
return context
|
||||
}
|
||||
}
|
||||
117
module/applications/sheets/starship-sheet.mjs
Normal file
117
module/applications/sheets/starship-sheet.mjs
Normal file
@@ -0,0 +1,117 @@
|
||||
import FTLNomadActorSheet from "./base-actor-sheet.mjs"
|
||||
|
||||
export default class FTLNomadStarshipSheet extends FTLNomadActorSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["vehicle"],
|
||||
position: {
|
||||
width: 680,
|
||||
height: 540,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["vehicle-content"],
|
||||
},
|
||||
actions: {
|
||||
createGear: FTLNomadStarshipSheet.#onCreateGear,
|
||||
createWeapon: FTLNomadStarshipSheet.#onCreateWeapon,
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-ftl-nomad/templates/starship-main.hbs",
|
||||
},
|
||||
tabs: {
|
||||
template: "templates/generic/tab-navigation.hbs",
|
||||
},
|
||||
equipment: {
|
||||
template: "systems/fvtt-ftl-nomad/templates/starship-equipment.hbs",
|
||||
},
|
||||
description: {
|
||||
template: "systems/fvtt-ftl-nomad/templates/starship-description.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
tabGroups = {
|
||||
sheet: "equipment",
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare an array of form header tabs.
|
||||
* @returns {Record<string, Partial<ApplicationTab>>}
|
||||
*/
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
equipment: { id: "equipment", group: "sheet", icon: "fa-solid fa-shapes", label: "FTLNOMAD.Label.equipment" },
|
||||
description: { id: "description", group: "sheet", icon: "fa-solid fa-book", label: "FTLNOMAD.Label.description" },
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
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
|
||||
}
|
||||
|
||||
_generateTooltip(type, target) {
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _preparePartContext(partId, context) {
|
||||
const doc = this.document
|
||||
switch (partId) {
|
||||
case "main":
|
||||
break
|
||||
case "equipment":
|
||||
context.tab = context.tabs.equipment
|
||||
context.weapons = doc.itemTypes.weapon
|
||||
context.gears = doc.itemTypes.gear
|
||||
break
|
||||
case "description":
|
||||
context.tab = context.tabs.description
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(doc.system.description, { async: true })
|
||||
context.enrichedNotes = await TextEditor.enrichHTML(doc.system.notes, { async: true })
|
||||
break
|
||||
}
|
||||
return context
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new attack item directly from the sheet and embeds it into the document.
|
||||
* @param {Event} event The initiating click event.
|
||||
* @param {HTMLElement} target The current target of the event listener.
|
||||
*/
|
||||
static #onCreateGear(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("FTLNOMAD.Label.newGear"), type: "gear" }])
|
||||
}
|
||||
|
||||
static #onCreateWeapon(event, target) {
|
||||
this.document.createEmbeddedDocuments("Item", [{ name: game.i18n.localize("FTLNOMAD.Label.newWeapon"), type: "weapon" }])
|
||||
}
|
||||
|
||||
|
||||
async _onDrop(event) {
|
||||
if (!this.isEditable || !this.isEditMode) return
|
||||
const data = TextEditor.getDragEventData(event)
|
||||
|
||||
// Handle different data types
|
||||
switch (data.type) {
|
||||
case "Item":
|
||||
const item = await fromUuid(data.uuid)
|
||||
return super._onDropItem(item)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ export default class FTLNomadTalentSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/talent.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/talent.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -12,24 +12,24 @@ export default class FTLNomadVehicleSheet extends FTLNomadActorSheet {
|
||||
contentClasses: ["vehicle-content"],
|
||||
},
|
||||
actions: {
|
||||
createGear: CthulhuEternalVehicleSheet.#onCreateGear,
|
||||
createWeapon: CthulhuEternalVehicleSheet.#onCreateWeapon,
|
||||
createGear: FTLNomadVehicleSheet.#onCreateGear,
|
||||
createWeapon: FTLNomadVehicleSheet.#onCreateWeapon,
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/vehicle-main.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/vehicle-main.hbs",
|
||||
},
|
||||
tabs: {
|
||||
template: "templates/generic/tab-navigation.hbs",
|
||||
},
|
||||
equipment: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/vehicle-equipment.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/vehicle-equipment.hbs",
|
||||
},
|
||||
description: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/vehicle-description.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/vehicle-description.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -35,12 +35,38 @@ export const SKILLS = {
|
||||
"technology": { id: "technology", label: "FTLNOMAD.Skill.Technology" }
|
||||
}
|
||||
|
||||
export const TECH_AGES = {
|
||||
"notech": { id: "notech", level: 0, label: "FTLNOMAD.TechAge.NoTech" },
|
||||
"earlyprimitive": { id: "earlyprimitive", label: "FTLNOMAD.TechAge.EarlyPrimitive", level: 1 },
|
||||
"lateprimitive": { id: "lateprimitive", label: "FTLNOMAD.TechAge.LatePrimitive", level: 2 },
|
||||
"earlymechanical": { id: "earlymechanical", label: "FTLNOMAD.TechAge.EarlyMechanical", level: 3 },
|
||||
"latemechanical": { id: "latemechanical", label: "FTLNOMAD.TechAge.LateMechanical", level: 4 },
|
||||
"earlyatomic": { id: "earlyatomic", label: "FTLNOMAD.TechAge.EarlyAtomic", level: 5 },
|
||||
"lateatomic": { id: "lateatomic", label: "FTLNOMAD.TechAge.LateAtomic", level: 6 },
|
||||
"earlyspace": { id: "earlyspace", label: "FTLNOMAD.TechAge.EarlySpace", level: 7 },
|
||||
"latespace": { id: "latespace", label: "FTLNOMAD.TechAge.LateSpace", level: 8 },
|
||||
"earlyinterstellar": { id: "earlyinterstellar", label: "FTLNOMAD.TechAge.EarlyInterstellar", level: 9 },
|
||||
"lateinterstellar": { id: "lateinterstellar", label: "FTLNOMAD.TechAge.LateInterstellar", level: 10 },
|
||||
"earlygalactic" : { id: "earlygalactic", label: "FTLNOMAD.TechAge.EarlyGalactic", level: 11 },
|
||||
"lategalactic": { id: "lategalactic", label: "FTLNOMAD.TechAge.LateGalactic", level: 12 },
|
||||
"cosmic": { id: "cosmic", label: "FTLNOMAD.TechAge.Cosmic", level: 13 }
|
||||
}
|
||||
|
||||
export const WEAPON_RANGE = {
|
||||
"melee": {id: "melee", label: "FTLNOMAD.Weapon.Range.Melee"},
|
||||
"handgun": {id: "handgun", label: "FTLNOMAD.Weapon.Range.Handgun"},
|
||||
"rifle" : {id: "rifle", label: "FTLNOMAD.Weapon.Range.Rifle"},
|
||||
"longrange": {id: "longrange", label: "FTLNOMAD.Weapon.Range.LongRange"},
|
||||
}
|
||||
|
||||
/**
|
||||
* Include all constant definitions within the SYSTEM global export
|
||||
* @type {Object}
|
||||
*/
|
||||
export const SYSTEM = {
|
||||
id: SYSTEM_ID,
|
||||
SKILLS: SKILLS,
|
||||
TECH_AGES,
|
||||
WEAPON_RANGE,
|
||||
SKILLS,
|
||||
ASCII
|
||||
}
|
||||
|
||||
@@ -3,8 +3,12 @@ export { default as FTLNomadPsionic } from "./psionic.mjs"
|
||||
export { default as FTLNomadLanguage } from "./language.mjs"
|
||||
export { default as FTLNomadTalent } from "./talent.mjs"
|
||||
export { default as FTLNomadArmor } from "./armor.mjs"
|
||||
export { default as FTLNomadNPC } from "./npc.mjs"
|
||||
export { default as FTLNomadCreature } from "./creature.mjs"
|
||||
export { default as FTLNomadVehicle } from "./vehicle.mjs"
|
||||
export { default as FTLNomadCharacter } from "./character.mjs"
|
||||
export { default as FTLNomadEquipment } from "./equipment.mjs"
|
||||
export { default as FTLNomadImplant } from "./implant.mjs"
|
||||
export { default as FTLNomadStarship } from "./starship.mjs"
|
||||
export { default as FTLNomadCreatureTrait } from "./creature-trait.mjs"
|
||||
export { default as FTLNomadCreatureAbility } from "./creature-ability.mjs"
|
||||
|
||||
|
||||
@@ -7,11 +7,10 @@ export default class FTLNomadArmor extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
let setting = game.settings.get("fvtt-cthulhu-eternal", "settings-era") || "modern"
|
||||
schema.settings = new fields.StringField({ required: true, initial: setting, choices: SYSTEM.AVAILABLE_SETTINGS })
|
||||
|
||||
schema.techage = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "latenuclear" })
|
||||
schema.protection = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.resourceLevel = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
schema.enc = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
return schema
|
||||
}
|
||||
|
||||
16
module/models/creature-ability.mjs
Normal file
16
module/models/creature-ability.mjs
Normal file
@@ -0,0 +1,16 @@
|
||||
import { SYSTEM } from "../config/system.mjs";
|
||||
|
||||
export default class FTLNomadCreatureAbility extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
schema.isadvantage = new fields.BooleanField({ required: true, initial: false });
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
return schema;
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNomad.CreatureAbility"];
|
||||
}
|
||||
16
module/models/creature-trait.mjs
Normal file
16
module/models/creature-trait.mjs
Normal file
@@ -0,0 +1,16 @@
|
||||
import { SYSTEM } from "../config/system.mjs";
|
||||
|
||||
export default class FTLNomadCreatureTrait extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
schema.isadvantage = new fields.BooleanField({ required: true, initial: false });
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
return schema;
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNomad.CreatureTrait"];
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SYSTEM } from "../config/system.mjs"
|
||||
import FTLNomadRoll from "../documents/roll.mjs"
|
||||
|
||||
export default class FTLNomadNPC extends foundry.abstract.TypeDataModel {
|
||||
export default class FTLNomadCreature extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields
|
||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||
@@ -8,11 +8,10 @@ export default class FTLNomadEquipment extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
let setting = game.settings.get("fvtt-cthulhu-eternal", "settings-era") || "modern"
|
||||
schema.settings = new fields.StringField({ required: true, initial: setting, choices: SYSTEM.AVAILABLE_SETTINGS })
|
||||
|
||||
schema.resourceLevel = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
schema.state = new fields.StringField({ required: true, initial: "pristine", choices: SYSTEM.EQUIPMENT_STATES })
|
||||
schema.techage = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "latenuclear" })
|
||||
|
||||
schema.enc = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
return schema
|
||||
}
|
||||
|
||||
22
module/models/implant.mjs
Normal file
22
module/models/implant.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { SYSTEM } from "../config/system.mjs"
|
||||
|
||||
export default class FTLNomadImplant extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields
|
||||
const schema = {}
|
||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
schema.techage = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "latenuclear" })
|
||||
|
||||
schema.enc = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
return schema
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Implant"]
|
||||
|
||||
}
|
||||
@@ -8,15 +8,6 @@ export default class FTLNomadPsionic extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
let setting = game.settings.get("fvtt-cthulhu-eternal", "settings-era") || "modern"
|
||||
schema.settings = new fields.StringField({ required: true, initial: setting, choices: SYSTEM.AVAILABLE_SETTINGS })
|
||||
|
||||
schema.base = new fields.StringField({ required: true, initial: "0" })
|
||||
schema.bonus = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.diceEvolved = new fields.BooleanField({ required: true, initial: true })
|
||||
schema.rollFailed = new fields.BooleanField({ required: true, initial: false })
|
||||
schema.isAdversary = new fields.BooleanField({ required: true, initial: false })
|
||||
|
||||
return schema
|
||||
}
|
||||
|
||||
|
||||
31
module/models/starship.mjs
Normal file
31
module/models/starship.mjs
Normal file
@@ -0,0 +1,31 @@
|
||||
import { SYSTEM } from "../config/system.mjs"
|
||||
import FTLNomadRoll from "../documents/roll.mjs"
|
||||
|
||||
export default class FTLNomadStarship extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields
|
||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||
const schema = {}
|
||||
|
||||
schema.agility = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.hullType = new fields.StringField({ required: true, initial: "small", choices: SYSTEM.STARSHIP_HULL })
|
||||
schema.endurance = new fields.StringField({ required: true, initial: "" })
|
||||
schema.armor = new fields.StringField({ required: true, initial: "" })
|
||||
schema.crew = new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 })
|
||||
schema.cargo = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.guns = new fields.StringField({ required: true, initial: "1d6" })
|
||||
schema.travelMultiplier = new fields.NumberField({ required: true, initial: 1, min: 0 })
|
||||
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
schema.monthlyCost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.modifications = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.notes = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
return schema
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNomad.Starship"]
|
||||
|
||||
}
|
||||
@@ -5,55 +5,8 @@ export default class FTLNomadTalent extends foundry.abstract.TypeDataModel {
|
||||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
let setting = game.settings.get("fvtt-cthulhu-eternal", "settings-era") || "modern"
|
||||
schema.minimumEra = new fields.StringField({ required: true, initial: setting, choices: SYSTEM.AVAILABLE_SETTINGS })
|
||||
|
||||
schema.creationDate = new fields.StringField({
|
||||
required: true,
|
||||
initial: "",
|
||||
textSearch: true
|
||||
});
|
||||
|
||||
// Language field
|
||||
schema.language = new fields.StringField({
|
||||
required: true,
|
||||
initial: "Latin",
|
||||
textSearch: true
|
||||
});
|
||||
|
||||
// studyTime field
|
||||
schema.studyTime = new fields.StringField({
|
||||
required: true,
|
||||
initial: "X days",
|
||||
textSearch: true
|
||||
});
|
||||
|
||||
// SAN loss field
|
||||
schema.sanLoss = new fields.StringField({
|
||||
required: true,
|
||||
initial: "1d4",
|
||||
textSearch: true
|
||||
});
|
||||
|
||||
// Unnatural skill field
|
||||
schema.unnaturalSkill = new fields.StringField({
|
||||
required: true,
|
||||
initial: "1d4",
|
||||
textSearch: true
|
||||
});
|
||||
|
||||
schema.rituals = new fields.StringField({
|
||||
required: true,
|
||||
initial: "",
|
||||
textSearch: true
|
||||
});
|
||||
|
||||
schema.otherBenefits = new fields.StringField({
|
||||
required: true,
|
||||
initial: "",
|
||||
textSearch: true
|
||||
});
|
||||
|
||||
schema.isadvantage = new fields.BooleanField({ required: true, initial: false });
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
return schema;
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import { SYSTEM } from "../config/system.mjs"
|
||||
import FTLNomadRoll from "../documents/roll.mjs"
|
||||
|
||||
export default class CthulhuEternalVehicle extends foundry.abstract.TypeDataModel {
|
||||
export default class FTLNomadVehicle extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields
|
||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||
const schema = {}
|
||||
|
||||
let setting = game.settings.get("fvtt-cthulhu-eternal", "settings-era") || "modern"
|
||||
schema.settings = new fields.StringField({ required: true, initial: setting, choices: SYSTEM.AVAILABLE_SETTINGS })
|
||||
|
||||
schema.hp = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 })
|
||||
|
||||
@@ -8,9 +8,11 @@ export default class FTLNomadWeapon extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
schema.weaponType = new fields.StringField({ required: true, initial: "melee", choices: SYSTEM.WEAPON_TYPE })
|
||||
schema.rangeType = new fields.StringField({ required: true, initial: "melee", choices: SYSTEM.WEAPON_RANGE })
|
||||
|
||||
schema.damage = new fields.StringField({required: true, initial: "1d6"})
|
||||
schema.magazine = new fields.NumberField({ required: true, initial: 1, min: 0 })
|
||||
|
||||
schema.range = new fields.SchemaField({
|
||||
close: new fields.NumberField({ ...requiredInteger, initial: 0 }),
|
||||
near: new fields.NumberField({ ...requiredInteger, initial: 0 }),
|
||||
@@ -22,6 +24,7 @@ export default class FTLNomadWeapon extends foundry.abstract.TypeDataModel {
|
||||
schema.aspect = new fields.StringField({ required: true, initial: ""})
|
||||
|
||||
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
schema.ammoCost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
return schema
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user