Initial items
This commit is contained in:
@@ -6,7 +6,7 @@ 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/creature-sheet.mjs"
|
||||
export { default as FTLNomadCreatureSheet } 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"
|
||||
|
||||
@@ -15,13 +15,15 @@ export default class FTLNomadArmorSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/armor.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/armor.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||
|
||||
return context
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import FTLNomadActorSheet from "./base-actor-sheet.mjs"
|
||||
|
||||
export default class FTLNomadNPCSheet extends FTLNomadActorSheet {
|
||||
export default class FTLNomadCreatureSheet extends FTLNomadActorSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["npc"],
|
||||
@@ -12,9 +12,9 @@ export default class FTLNomadNPCSheet extends FTLNomadActorSheet {
|
||||
contentClasses: ["npc-content"],
|
||||
},
|
||||
actions: {
|
||||
createArmor: FTLNomadNPCSheet.#onCreateArmor,
|
||||
createWeapon: FTLNomadNPCSheet.#onCreateWeapon,
|
||||
createSkill: FTLNomadNPCSheet.#onCreateSkill,
|
||||
createArmor: FTLNomadCreatureSheet.#onCreateArmor,
|
||||
createWeapon: FTLNomadCreatureSheet.#onCreateWeapon,
|
||||
createSkill: FTLNomadCreatureSheet.#onCreateSkill,
|
||||
|
||||
},
|
||||
}
|
||||
@@ -22,16 +22,16 @@ export default class FTLNomadNPCSheet extends FTLNomadActorSheet {
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/npc-main.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/creature-main.hbs",
|
||||
},
|
||||
tabs: {
|
||||
template: "templates/generic/tab-navigation.hbs",
|
||||
},
|
||||
skills: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/npc-skills.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/creature-skills.hbs",
|
||||
},
|
||||
biography: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/npc-biography.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/creature-biography.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,14 @@ export default class FTLNomadEquipmentSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/equipment.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/equipment.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||
return context
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class FTLNomadImplantSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/implant.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/implant.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class FTLNomadLanguageSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/language.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/language.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class FTLNomadPsionicSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/psionic.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/psionic.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class FTLNomadWeaponSheet extends FTLNomadItemSheet {
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-cthulhu-eternal/templates/weapon.hbs",
|
||||
template: "systems/fvtt-ftl-nomad/templates/weapon.hbs",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,18 @@
|
||||
export const SYSTEM_ID = "fvtt-ftl-nomad"
|
||||
|
||||
export const ASCII = `
|
||||
░ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄
|
||||
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░░▌ ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌
|
||||
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀ ▐░▌ ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌░▌ ▐░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀
|
||||
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
|
||||
▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌
|
||||
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌
|
||||
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀█░█▀▀ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░▌
|
||||
▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌
|
||||
▐░▌ ▐░▌ ▐░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▄▄▄▄█░█▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░▌
|
||||
▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌
|
||||
▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀
|
||||
▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄
|
||||
▐░░▌ ▐░▌▐░░░░░░░░░░░▌▐░░▌ ▐░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌
|
||||
▐░▌░▌ ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌░▌ ▐░▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌
|
||||
▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌ ▐░▌
|
||||
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌
|
||||
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌
|
||||
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▀ ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌
|
||||
▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌
|
||||
▐░▌ ▐░▐░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌
|
||||
▐░▌ ▐░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░░░░░░░░░░▌
|
||||
▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀
|
||||
`
|
||||
|
||||
░▒▓████████▓▒░▒▓████████▓▒░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░░▒▓██████████████▓▒░ ░▒▓██████▓▒░░▒▓███████▓▒░
|
||||
░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
|
||||
░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
|
||||
░▒▓██████▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░
|
||||
░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
|
||||
░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
|
||||
░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓████████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░
|
||||
|
||||
|
||||
|
||||
`
|
||||
|
||||
export const SKILLS = {
|
||||
"combat": { id: "combat", label: "FTLNOMAD.Skill.Combat" },
|
||||
@@ -52,11 +41,61 @@ export const TECH_AGES = {
|
||||
"cosmic": { id: "cosmic", label: "FTLNOMAD.TechAge.Cosmic", level: 13 }
|
||||
}
|
||||
|
||||
|
||||
export const WEAPON_TYPES = {
|
||||
"melee": { id: "melee", label: "FTLNOMAD.Weapon.Types.Melee" },
|
||||
"projectile": { id: "projectile", label: "FTLNOMAD.Weapon.Types.Projectile" },
|
||||
"energy": { id: "energy", label: "FTLNOMAD.Weapon.Types.Energy" },
|
||||
"heavy": { id: "heavy", label: "FTLNOMAD.Weapon.Types.Heavy" },
|
||||
"grenade": { id: "grenade", label: "FTLNOMAD.Weapon.Types.Grenade" },
|
||||
"vehicle": { id: "vehicle", label: "FTLNOMAD.Weapon.Types.Vehicle" }
|
||||
}
|
||||
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" },
|
||||
"longrange": { id: "longrange", label: "FTLNOMAD.Weapon.Range.LongRange" }
|
||||
}
|
||||
|
||||
export const TRIAGE_RESULTS = {
|
||||
"none": { id: "none", dice:0, label: "FTLNOMAD.TriageResults.None" },
|
||||
"death": { id: "death", dice:3, label: "FTLNOMAD.TriageResults.Death" },
|
||||
"critical": { id: "critical", dice:4, label: "FTLNOMAD.TriageResults.Critical" },
|
||||
"severe": { id: "severe", dice:7, label: "FTLNOMAD.TriageResults.Severe" },
|
||||
"moderate": { id: "moderate", dice:10, label: "FTLNOMAD.TriageResults.Moderate" },
|
||||
"fleshwound": { id: "fleshwound", dice:12, label: "FTLNOMAD.TriageResults.FleshWound" }
|
||||
}
|
||||
|
||||
export const CREATURE_TERRAIN_TYPES = {
|
||||
"cave": { id: "cave", label: "FTLNOMAD.Creature.Terrain.Cave", niche:0, size: 0 },
|
||||
"coast": { id: "coast", label: "FTLNOMAD.Creature.Terrain.Coast", niche:1, size: 0 },
|
||||
"desert": { id: "desert", label: "FTLNOMAD.Creature.Terrain.Desert", niche:-1, size: -1 },
|
||||
"forest": { id: "forest", label: "FTLNOMAD.Creature.Terrain.Forest", niche:1, size: 1 },
|
||||
"jungle": { id: "jungle", label: "FTLNOMAD.Creature.Terrain.Jungle", niche:1, size: 1 },
|
||||
"mixed": { id: "mixed", label: "FTLNOMAD.Creature.Terrain.Mixed", niche:0, size: 0 },
|
||||
"mountain": { id: "mountain", label: "FTLNOMAD.Creature.Terrain.Mountain", niche:-1, size: -1 },
|
||||
"ocean": { id: "ocean", label: "FTLNOMAD.Creature.Terrain.Ocean", niche:-1, size: 1 },
|
||||
"river": { id: "river", label: "FTLNOMAD.Creature.Terrain.River", niche:1, size: 0 },
|
||||
"ruins": { id: "ruins", label: "FTLNOMAD.Creature.Terrain.Ruins", niche:0, size: 1 },
|
||||
"savannah": { id: "savannah", label: "FTLNOMAD.Creature.Terrain.Savannah", niche:0, size: 1 },
|
||||
"shallows": { id: "shallows", label: "FTLNOMAD.Creature.Terrain.Shallows", niche:1, size: 0 },
|
||||
"swamp": { id: "swamp", label: "FTLNOMAD.Creature.Terrain.Swamp", niche:1, size: 1 }
|
||||
}
|
||||
|
||||
export const CREATURE_NICHES = {
|
||||
"prey": { id: "prey", label: "FTLNOMAD.Creature.Niche.Prey" },
|
||||
"opportunist": { id: "opportunist", label: "FTLNOMAD.Creature.Niche.Opportunist" },
|
||||
"herbivore": { id: "herbivore", label: "FTLNOMAD.Creature.Niche.Herbivore" },
|
||||
"predator": { id: "predator", label: "FTLNOMAD.Creature.Niche.Predator" }
|
||||
}
|
||||
|
||||
export const CREATURE_SIZES = {
|
||||
"tiny": { id: "tiny", label: "FTLNOMAD.Creature.Size.Tiny" },
|
||||
"small": { id: "small", label: "FTLNOMAD.Creature.Size.Small" },
|
||||
"medium": { id: "medium", label: "FTLNOMAD.Creature.Size.Medium" },
|
||||
"large": { id: "large", label: "FTLNOMAD.Creature.Size.Large" },
|
||||
"giant": { id: "giant", label: "FTLNOMAD.Creature.Size.Giant" },
|
||||
"titanic": { id: "titanic", label: "FTLNOMAD.Creature.Size.Titanic" }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +105,11 @@ export const WEAPON_RANGE = {
|
||||
export const SYSTEM = {
|
||||
id: SYSTEM_ID,
|
||||
TECH_AGES,
|
||||
WEAPON_TYPES,
|
||||
WEAPON_RANGE,
|
||||
TRIAGE_RESULTS,
|
||||
CREATURE_TERRAIN_TYPES,
|
||||
CREATURE_SIZES,
|
||||
SKILLS,
|
||||
ASCII
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export default class FTLNomadArmor extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
schema.techage = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "latenuclear" })
|
||||
schema.techAge = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "lateatomic" })
|
||||
schema.protection = new fields.NumberField({ ...requiredInteger, 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 })
|
||||
|
||||
@@ -17,7 +17,7 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
|
||||
// Carac
|
||||
const skillField = (label) => {
|
||||
const schema = {
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
|
||||
}
|
||||
return new fields.SchemaField(schema, { label })
|
||||
}
|
||||
@@ -29,177 +29,48 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
|
||||
}, {}),
|
||||
)
|
||||
|
||||
schema.wp = new fields.SchemaField({
|
||||
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: 1, min: 0 }),
|
||||
triageResults: new fields.StringField({ required: true, nullable: false, initial: "none", choices: SYSTEM.TRIAGE_RESULTS })
|
||||
})
|
||||
|
||||
schema.enc = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 3, min: 0 }),
|
||||
exhausted: new fields.BooleanField({ required: true, initial: false })
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
})
|
||||
|
||||
schema.hp = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
stunned: new fields.BooleanField({ required: true, initial: false })
|
||||
})
|
||||
|
||||
schema.san = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
recovery: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
violence: new fields.ArrayField(new fields.BooleanField(), { required: true, initial: [false, false, false], min:3, max:3}),
|
||||
helplessness: new fields.ArrayField(new fields.BooleanField(), { required: true, initial: [false, false, false], min:3, max:3 }),
|
||||
breakingPoint: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
insanity: new fields.StringField({ required: true, nullable: false, initial: "none", choices:SYSTEM.INSANITY }),
|
||||
})
|
||||
|
||||
schema.damageBonus = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
|
||||
schema.resources = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }), // Unused but kept for compatibility
|
||||
permanentRating: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
hand: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
currentHand: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
stowed: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
currentStowed: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
storage: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
currentStorage: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
checks: new fields.ArrayField(new fields.BooleanField(), { required: true, initial: [false, false, false], min:3, max:3 }),
|
||||
nbValidChecks: new fields.NumberField({ ...requiredInteger, initial: 0, 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.biodata = new fields.SchemaField({
|
||||
age: new fields.NumberField({ ...requiredInteger, initial: 15, min: 6 }),
|
||||
archetype: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
height: new fields.NumberField({ ...requiredInteger, initial: 170, min: 50 }),
|
||||
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: "" }),
|
||||
harshness: new fields.StringField({ required: true, nullable: false, initial: "normal", choices:SYSTEM.HARSHNESS }),
|
||||
adaptedToViolence: new fields.BooleanField({ required: true, initial: false }),
|
||||
adaptedToHelplessness: new fields.BooleanField({ required: true, initial: false })
|
||||
hair: new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
})
|
||||
|
||||
return schema
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Protagonist"]
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Character"]
|
||||
|
||||
prepareDerivedData() {
|
||||
super.prepareDerivedData();
|
||||
|
||||
let updates = {}
|
||||
if ( this.wp.max !== this.characteristics.pow.value) {
|
||||
updates[`system.wp.max`] = this.characteristics.pow.value
|
||||
}
|
||||
let hpMax = Math.round((this.characteristics.con.value + this.characteristics.str.value) / 2)
|
||||
if ( this.hp.max !== hpMax) {
|
||||
updates[`system.hp.max`] = hpMax
|
||||
}
|
||||
|
||||
// Get Unnatural skill for MAX SAN
|
||||
let unnatural = this.parent.items.find(i => i.type === "skill" && i.name.toLowerCase() === game.i18n.localize("FTLNOMAD.Skill.Unnatural").toLowerCase())
|
||||
let minus = 0
|
||||
if (unnatural) {
|
||||
minus = unnatural.system.skillTotal
|
||||
}
|
||||
let maxSan = Math.max(99 - minus, 0)
|
||||
if ( this.san.max !== maxSan) {
|
||||
updates[`system.san.max`] = maxSan
|
||||
}
|
||||
|
||||
let recoverySan = this.characteristics.pow.value * 5
|
||||
if (recoverySan > this.san.max) {
|
||||
recoverySan = this.san.max
|
||||
}
|
||||
if ( this.san.recovery !== recoverySan) {
|
||||
updates[`system.san.recovery`] = recoverySan
|
||||
}
|
||||
|
||||
let dmgBonus = 0
|
||||
if (this.characteristics.str.value <= 4) {
|
||||
dmgBonus = -2
|
||||
} else if (this.characteristics.str.value <= 8) {
|
||||
dmgBonus = -1
|
||||
} else if (this.characteristics.str.value <= 12) {
|
||||
dmgBonus = 0
|
||||
} else if (this.characteristics.str.value <= 16) {
|
||||
dmgBonus = 1
|
||||
} else if (this.characteristics.str.value <= 20) {
|
||||
dmgBonus = 2
|
||||
}
|
||||
if ( this.damageBonus !== dmgBonus) {
|
||||
updates[`system.damageBonus`] = dmgBonus
|
||||
}
|
||||
|
||||
// Sanity check
|
||||
if (this.san.value > this.san.max) {
|
||||
updates[`system.san.value`] = this.san.max
|
||||
}
|
||||
if (this.wp.value > this.wp.max) {
|
||||
updates[`system.wp.value`] = this.wp.max
|
||||
}
|
||||
if (this.hp.value > this.hp.max) {
|
||||
updates[`system.hp.value`] = this.hp.max
|
||||
}
|
||||
|
||||
if (this.resources.permanentRating < 0) {
|
||||
updates[`system.resources.permanentRating`] = 0
|
||||
}
|
||||
|
||||
let resourceIndex = Math.max(Math.min(this.resources.permanentRating, 20), 0)
|
||||
let breakdown = SYSTEM.RESOURCE_BREAKDOWN[resourceIndex]
|
||||
if (this.resources.hand !== breakdown.hand) {
|
||||
updates[`system.resources.hand`] = breakdown.hand
|
||||
}
|
||||
if (this.resources.stowed !== breakdown.stowed) {
|
||||
updates[`system.resources.stowed`] = breakdown.stowed
|
||||
}
|
||||
if (this.resources.storage !== breakdown.storage) {
|
||||
updates[`system.resources.storage`] = breakdown.storage + (this.resources.permanentRating - resourceIndex)
|
||||
}
|
||||
if (this.resources.nbValidChecks !== breakdown.checks) {
|
||||
updates[`system.resources.nbValidChecks`] = breakdown.checks
|
||||
}
|
||||
|
||||
if (Object.keys(updates).length > 0) {
|
||||
this.parent.update(updates)
|
||||
}
|
||||
}
|
||||
|
||||
isLowWP() {
|
||||
return this.wp.value <= 2
|
||||
}
|
||||
|
||||
isZeroWP() {
|
||||
return this.wp.value === 0
|
||||
}
|
||||
|
||||
isExhausted() {
|
||||
return this.wp.exhausted
|
||||
}
|
||||
|
||||
modifyWP(value) {
|
||||
let updates = {}
|
||||
let wp = Math.max(Math.min(this.wp.value + value, this.wp.max), 0)
|
||||
if ( this.wp.value !== wp) {
|
||||
updates[`system.wp.value`] = wp
|
||||
}
|
||||
if (Object.keys(updates).length > 0) {
|
||||
this.parent.update(updates)
|
||||
}
|
||||
}
|
||||
|
||||
setBP() {
|
||||
let updates = {}
|
||||
let bp = Math.max(this.san.value - this.characteristics.pow.value, 0)
|
||||
if ( this.san.breakingPoint !== bp) {
|
||||
updates[`system.san.breakingPoint`] = bp
|
||||
}
|
||||
if (Object.keys(updates).length > 0) {
|
||||
this.parent.update(updates)
|
||||
}
|
||||
}
|
||||
|
||||
/** */
|
||||
@@ -216,9 +87,6 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
|
||||
let roll = await CthulhuEternalRoll.prompt({
|
||||
rollType,
|
||||
rollItem,
|
||||
isLowWP: this.isLowWP(),
|
||||
isZeroWP: this.isZeroWP(),
|
||||
isExhausted: this.isExhausted(),
|
||||
actorId: this.parent.id,
|
||||
actorName: this.parent.name,
|
||||
actorImage: this.parent.img,
|
||||
|
||||
@@ -5,12 +5,12 @@ export default class FTLNomadCreatureAbility extends foundry.abstract.TypeDataMo
|
||||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
schema.isadvantage = new fields.BooleanField({ required: true, initial: false });
|
||||
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"];
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.CreatureAbility"];
|
||||
}
|
||||
@@ -5,12 +5,12 @@ export default class FTLNomadCreatureTrait extends foundry.abstract.TypeDataMode
|
||||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
schema.isadvantage = new fields.BooleanField({ required: true, initial: false });
|
||||
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"];
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.CreatureTrait"];
|
||||
}
|
||||
@@ -7,38 +7,31 @@ export default class FTLNomadCreature extends foundry.abstract.TypeDataModel {
|
||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||
const schema = {}
|
||||
|
||||
// Carac
|
||||
const characteristicField = (label) => {
|
||||
const skillField = (label) => {
|
||||
const schema = {
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 3, min: 0 }),
|
||||
feature: new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
|
||||
enabled: new fields.BooleanField({ required: true, initial: true }),
|
||||
}
|
||||
return new fields.SchemaField(schema, { label })
|
||||
}
|
||||
|
||||
schema.characteristics = new fields.SchemaField(
|
||||
Object.values(SYSTEM.CHARACTERISTICS).reduce((obj, characteristic) => {
|
||||
obj[characteristic.id] = characteristicField(characteristic.label)
|
||||
schema.skills = new fields.SchemaField(
|
||||
Object.values(SYSTEM.SKILLS).reduce((obj, characteristic) => {
|
||||
obj[characteristic.id] = skillField(characteristic.label)
|
||||
return obj
|
||||
}, {}),
|
||||
)
|
||||
|
||||
schema.wp = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 3, min: 0 }),
|
||||
exhausted: new fields.BooleanField({ required: true, initial: false })
|
||||
})
|
||||
schema.terrain = new fields.StringField({ required: true, nullable: false, initial: "cave", choices: SYSTEM.CREATURE_TERRAIN_TYPES })
|
||||
schema.niche = new fields.StringField({ required: true, nullable: false, initial: "prey", choices: SYSTEM.CREATURE_NICHES })
|
||||
schema.size = new fields.StringField({ required: true, nullable: false, initial: "small", choices: SYSTEM.CREATURE_SIZES })
|
||||
|
||||
schema.hp = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 })
|
||||
schema.numberAppearing = new fields.StringField({ required: true, initial: "1d6" })
|
||||
schema.health = new fields.SchemaField({
|
||||
staminaValue: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
staminaMax: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
})
|
||||
schema.movement = new fields.StringField({ required: true, initial: "" })
|
||||
schema.sanLoss = new fields.StringField({ required: true, initial: "1/1D6" })
|
||||
|
||||
schema.armor = new fields.StringField({ required: true, initial: "" })
|
||||
schema.size = new fields.StringField({ required: true, initial: "medium", choices: SYSTEM.CREATURE_SIZE })
|
||||
schema.damageBonus = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.damage = new fields.StringField({ required: true, initial: "1d6" })
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.notes = new fields.HTMLField({ required: true, textSearch: true })
|
||||
@@ -47,7 +40,7 @@ export default class FTLNomadCreature extends foundry.abstract.TypeDataModel {
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.NPC"]
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Creature"]
|
||||
|
||||
/** */
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ export default class FTLNomadEquipment extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
schema.techage = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "latenuclear" })
|
||||
schema.techAge = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "lateatomic" })
|
||||
|
||||
schema.enc = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
@@ -8,7 +8,7 @@ export default class FTLNomadImplant extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
schema.techage = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "latenuclear" })
|
||||
schema.techAge = new fields.StringField({ required: true, choices: SYSTEM.TECH_AGES, initial : "lateatomic" })
|
||||
|
||||
schema.enc = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
@@ -26,6 +26,6 @@ export default class FTLNomadStarship extends foundry.abstract.TypeDataModel {
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNomad.Starship"]
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Starship"]
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ export default class FTLNomadTalent extends foundry.abstract.TypeDataModel {
|
||||
const fields = foundry.data.fields;
|
||||
const schema = {};
|
||||
|
||||
schema.isadvantage = new fields.BooleanField({ required: true, initial: false });
|
||||
schema.isAdvantage = new fields.BooleanField({ required: true, initial: false });
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
@@ -13,5 +13,5 @@ export default class FTLNomadTalent extends foundry.abstract.TypeDataModel {
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNomad.Talent"];
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Talent"];
|
||||
}
|
||||
@@ -7,19 +7,18 @@ export default class FTLNomadVehicle extends foundry.abstract.TypeDataModel {
|
||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||
const schema = {}
|
||||
|
||||
schema.hp = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 })
|
||||
})
|
||||
schema.agility = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.armor = new fields.StringField({ required: true, initial: "" })
|
||||
schema.cargo = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.crew = new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 })
|
||||
schema.force = new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 })
|
||||
schema.range = new fields.StringField({ required: true, initial: "1d6" })
|
||||
schema.speed = new fields.StringField({ required: true, initial: "1d6" })
|
||||
schema.techAge = new fields.StringField({ required: true, initial: "1d6" })
|
||||
schema.tonnage = new fields.NumberField({ required: true, initial: 1, min: 0 })
|
||||
|
||||
schema.armor = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.surfaceSpeed = new fields.StringField({ required: true, initial: "slow", choices: SYSTEM.VEHICLE_SPEED })
|
||||
schema.airSpeed = new fields.StringField({ required: true, initial: "none", choices: SYSTEM.VEHICLE_SPEED })
|
||||
schema.state = new fields.StringField({ required: true, initial: "pristine", choices: SYSTEM.EQUIPMENT_STATES })
|
||||
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
schema.crew = new fields.ArrayField(new fields.StringField(), { required: false, initial: [], min:0 })
|
||||
schema.resourceLevel = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||
schema.notes = new fields.HTMLField({ required: true, textSearch: true })
|
||||
|
||||
@@ -27,6 +26,6 @@ export default class FTLNomadVehicle extends foundry.abstract.TypeDataModel {
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNomad.Vehicle"]
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Vehicle"]
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ export default class FTLNomadWeapon extends foundry.abstract.TypeDataModel {
|
||||
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 : "lateatomic" })
|
||||
schema.weaponType = new fields.StringField({ required: true, initial: "melee", choices: SYSTEM.WEAPON_TYPES })
|
||||
schema.rangeType = new fields.StringField({ required: true, initial: "melee", choices: SYSTEM.WEAPON_RANGE })
|
||||
|
||||
schema.damage = new fields.StringField({required: true, initial: "1d6"})
|
||||
|
||||
Reference in New Issue
Block a user