Initial items

This commit is contained in:
2025-02-16 20:31:01 +01:00
parent 2fc01d6d20
commit 2817acbf7b
30 changed files with 329 additions and 503 deletions

View File

@@ -2250,6 +2250,88 @@ i.fvtt-cthulhu-eternal {
.fvtt-ftl-nomad .equipment-content label { .fvtt-ftl-nomad .equipment-content label {
flex: 10%; flex: 10%;
} }
.fvtt-ftl-nomad .implant-content {
font-family: var(--font-primary);
font-size: calc(var(--font-size-standard) * 1);
color: var(--color-dark-1);
background-image: var(--background-image-base);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.fvtt-ftl-nomad .implant-content input:disabled,
.fvtt-ftl-nomad .implant-content select:disabled {
background-color: rgba(0, 0, 0, 0.2);
border-color: transparent;
color: var(--color-dark-3);
}
.fvtt-ftl-nomad .implant-content input,
.fvtt-ftl-nomad .implant-content select {
background-color: rgba(0, 0, 0, 0.1);
border-color: var(--color-dark-6);
color: var(--color-dark-2);
}
.fvtt-ftl-nomad .implant-content input[name="name"] {
height: 40px;
margin-right: 10px;
font-family: var(--font-secondary);
font-size: calc(var(--font-size-standard) * 1);
font-weight: bold;
border: none;
}
.fvtt-ftl-nomad .implant-content fieldset {
margin-bottom: 4px;
border-radius: 4px;
}
.fvtt-ftl-nomad .implant-content .form-fields input,
.fvtt-ftl-nomad .implant-content .form-fields select {
text-align: center;
font-size: calc(var(--font-size-standard) * 1);
}
.fvtt-ftl-nomad .implant-content .form-fields select {
font-family: var(--font-secondary);
font-size: calc(var(--font-size-standard) * 1);
}
.fvtt-ftl-nomad .implant-content legend {
font-family: var(--font-secondary);
font-size: calc(var(--font-size-standard) * 1.2);
font-weight: bold;
letter-spacing: 1px;
}
.fvtt-ftl-nomad .implant-content .form-fields {
padding-top: 4px;
}
.fvtt-ftl-nomad .implant-content label {
font-family: var(--font-secondary);
font-size: calc(var(--font-size-standard) * 1);
flex: 50%;
}
.fvtt-ftl-nomad .implant-content .align-top {
align-self: flex-start;
padding: 0.1rem;
margin-right: 0.2rem;
/*border-color: black;
border-width: 1px;
border-style: solid;
border-radius: 2%;*/
}
.fvtt-ftl-nomad .implant-content .shift-right {
margin-left: 2rem;
}
.fvtt-ftl-nomad .implant-content fieldset {
margin-top: 8px;
background-color: var(--color-light-1);
}
.fvtt-ftl-nomad .implant-content .header {
background-color: var(--color-light-1);
display: flex;
}
.fvtt-ftl-nomad .implant-content .header img {
width: 50px;
height: 50px;
}
.fvtt-ftl-nomad .implant-content label {
flex: 10%;
}
.fvtt-ftl-nomad .language-content { .fvtt-ftl-nomad .language-content {
font-family: var(--font-primary); font-family: var(--font-primary);
font-size: calc(var(--font-size-standard) * 1); font-size: calc(var(--font-size-standard) * 1);

View File

@@ -34,7 +34,7 @@ Hooks.once("init", function () {
CONFIG.Actor.dataModels = { CONFIG.Actor.dataModels = {
protagonist: models.FTLNomadCharacter, protagonist: models.FTLNomadCharacter,
vehicle: models.FTLNomadVehicle, vehicle: models.FTLNomadVehicle,
creature: models.FTLNomadNPC, creature: models.FTLNomadCreature,
starship: models.FTLNomadStarship starship: models.FTLNomadStarship
} }
@@ -46,7 +46,9 @@ Hooks.once("init", function () {
talent: models.FTLNomadTalent, talent: models.FTLNomadTalent,
language: models.FTLNomadLanguage, language: models.FTLNomadLanguage,
equipment: models.FTLNomadEquipment, equipment: models.FTLNomadEquipment,
implant: models.FTLNomadImplant implant: models.FTLNomadImplant,
"creature-trait": models.FTLNomadCreatureTrait,
"creature-ability": models.FTLNomadCreatureAbility
} }
// Register sheet application classes // Register sheet application classes
@@ -86,8 +88,7 @@ Hooks.once("init", function () {
FTLNomadUtils.registerSettings() FTLNomadUtils.registerSettings()
FTLNomadUtils.registerHandlebarsHelpers() FTLNomadUtils.registerHandlebarsHelpers()
FTLNomadUtils.setupCSSRootVariables()
console.info("FTL Nomad | System Initialized") console.info("FTL Nomad | System Initialized")
}) })

View File

@@ -160,12 +160,6 @@
} }
} }
}, },
"Insanity": {
"None": "None",
"Flee": "Flee",
"Submit": "Submit",
"Struggle": "Struggle"
},
"Skill": { "Skill": {
"Unnatural": "Unnatural", "Unnatural": "Unnatural",
"Melee": "Melee Weapons", "Melee": "Melee Weapons",
@@ -198,100 +192,91 @@
} }
} }
}, },
"Gear": { "Equipment": {
"FIELDS": { "FIELDS": {
"resourceLevel": { "techAge": {
"label": "Resource level" "label": "Tech Age"
}, },
"state": { "description": {
"label": "State" "label": "Description"
}, },
"settings": { "enc": {
"label": "Settings era" "label": "Enc"
},
"cost": {
"label": "Cost"
} }
} }
}, },
"Injury": { "Psionic": {
"FIELDS": { "FIELDS": {
"description": { "description": {
"label": "Description" "label": "Description"
},
"isAdvantage" :{
"label": "Provide advantage"
} }
} }
}, },
"Weapon": { "Weapon": {
"WeaponType": { "Types": {
"melee": "Melee", "Melee": "Melee",
"rangedprimitive": "Ranged Primitive", "Projectile": "Projectile",
"rangedthrown": "Ranged Thrown", "Energy": "Energy",
"rangedfirearm": "Ranged Firearm", "Heavy": "Heavy",
"unarmed": "Unarmed" "Grenade": "Grenade/Explosive",
"Vehicle": "Vehicle"
}, },
"WeaponSubtype": { "Range": {
"basicfirearm": "Basic Firearm", "Melee": "Melee",
"pistol": "Pistol", "Handgun": "Handgun",
"shotgun": "Shotgun", "Rifle": "Rifle",
"submachinegun": "Submachinegun", "LongRange": "Long Range"
"riflecarabine": "Rifle/Carabine"
}, },
"FIELDS": { "FIELDS": {
"hasDirectSkill": { "techAge": {
"label": "Has direct skill" "label": "Tech Age"
}, },
"directSkillValue": { "rangeType": {
"label": "Direct skill value" "label": "Range"
},
"state": {
"label": "State"
},
"settings": {
"label": "Settings era"
}, },
"weaponType": { "weaponType": {
"label": "Type" "label": "Type"
}, },
"weaponSubtype": {
"label": "Firearm Subtype"
},
"damage": { "damage": {
"label": "Damage" "label": "Damage"
}, },
"enc": {
"label": "Enc"
},
"cost": {
"label": "Cost"
},
"description": { "description": {
"label": "Description" "label": "Description"
},
"baseRange": {
"label": "Base range"
},
"rangeUnit": {
"label": "Range unit"
},
"killRadius": {
"label": "Kill radius"
},
"lethality": {
"label": "Lethality"
},
"resourceLevel": {
"label": "Resource level"
},
"armorPiercing": {
"label": "Armor piercing"
} }
} }
}, },
"Armor": { "Armor": {
"FIELDS": { "FIELDS": {
"settings": { "techAge": {
"label": "Settings Era" "label": "Tech Age"
}, },
"protection": { "protection": {
"label": "Protection" "label": "Protection"
}, },
"resourceLevel": { "description": {
"label": "Resource level" "label": "Description"
},
"enc": {
"label": "Enc"
},
"cost": {
"label": "Cost"
} }
} }
}, },
"Motivation": { "Language": {
"FIELDS": { "FIELDS": {
"description": { "description": {
"label": "Description" "label": "Description"
@@ -326,30 +311,43 @@
} }
} }
}, },
"MentalDisorder": { "CreatureTrait": {
"FIELDS": { "FIELDS": {
"description": { "description": {
"label": "Description" "label": "Description"
}, },
"cured": { "isAdvantage": {
"label": "Cured" "label": "Provide advantage"
} }
} }
}, },
"Bond": { "CreatureAbility": {
"FIELDS": { "FIELDS": {
"bondType": { "description": {
"label": "Type" "label": "Description"
},
"isAdvantage": {
"label": "Provide advantage"
}
}
},
"Implant": {
"FIELDS": {
"techAge": {
"label": "Tech Age"
}, },
"description": { "description": {
"label": "Description" "label": "Description"
}, },
"value": { "enc": {
"label": "Value" "label": "Enc"
},
"cost": {
"label": "Cost"
} }
} }
}, },
"Arcane": { "Starship": {
"FIELDS": { "FIELDS": {
"value": { "value": {
"label": "Value" "label": "Value"
@@ -359,90 +357,10 @@
} }
} }
}, },
"Archetype": { "Talent": {
"FIELDS": { "FIELDS": {
"settings": { "isAdvantage": {
"label": "Settings era" "label": "Provide advantage"
},
"value": {
"label": "Value"
},
"description": {
"label": "Description"
}
}
},
"BondType": {
"individual": "Individual",
"community": "Community"
},
"Harshness": {
"normal": "Normal",
"harsh": "Harsh",
"veryHarsh": "Very Harsh"
},
"Tome": {
"FIELDS": {
"language": {
"label": "Language"
},
"settings": {
"label": "Settings"
},
"studyTime": {
"label": "Study Time"
},
"sanLoss": {
"label": "SAN Loss"
},
"unnaturalSkill": {
"label": "Unnatural Skill"
},
"rituals": {
"label": "Rituals"
},
"minimumEra": {
"label": "Minimum Era"
},
"otherBenefits": {
"label": "Other Benefits"
},
"creationDate": {
"label": "Creation Date"
},
"description": {
"label": "Description"
}
},
"Label": {
"tomeDetails": "Tome Details"
},
"Button": {
"addRitual": "Add Ritual"
}
},
"Ritual": {
"Simple": "Simple",
"Complex": "Complex",
"Elaborate": "Elaborate",
"FIELDS": {
"ritualType": {
"label": "Type"
},
"studyTime": {
"label": "Study time"
},
"studySAN": {
"label": "Study SAN"
},
"activationTime": {
"label": "Activation time"
},
"activationSAN": {
"label": "Activation SAN"
},
"activationWP": {
"label": "Activation WP"
}, },
"description": { "description": {
"label": "Description" "label": "Description"
@@ -451,64 +369,20 @@
}, },
"Label": { "Label": {
"creature": "Creature", "creature": "Creature",
"Rituals": "Rituals",
"Tomes": "Tomes",
"otherBenefits": "Other Benefits",
"Unarmed": "Unarmed", "Unarmed": "Unarmed",
"Cured": "Cured",
"Uncured": "Uncured",
"nudgedRoll": "Nudged Roll",
"selectNewValue": "Select the new value",
"wpCost": "WP Cost",
"Hand": "Hand",
"Stowed": "Stowed",
"Storage": "Storage",
"resourceRating": "Resource rating",
"Resources": "Resources",
"multiplier": "Multiplier", "multiplier": "Multiplier",
"setBP": "Set BP",
"Vehicle": "Vehicle", "Vehicle": "Vehicle",
"Speed": "Speed",
"Slow": "Slow",
"Fast": "Fast",
"Average": "Average",
"None": "None",
"Pristine": "Pristine",
"Worn": "Worn",
"Junk": "Junk",
"resources": "Resources",
"resourceChecks": "Resource Checks",
"sanBPShort": "BP",
"tempInsanity": "Temp. Insanity",
"distinguishingFeatures": "Distinguishing Features",
"titleSkill": "Skill Roll", "titleSkill": "Skill Roll",
"titleWeapon": "Weapon Roll", "titleWeapon": "Weapon Roll",
"titleCharacteristic": "Characteristic Roll",
"titleSAN": "SAN Roll",
"biodata": "Biodata", "biodata": "Biodata",
"skill": "Skill", "skill": "Skill",
"modifier": "Modifier", "modifier": "Modifier",
"rollView": "Roll View", "rollView": "Roll View",
"protagonist": "Protagonist", "character": "Character",
"characteristics": "Characteristics",
"description": "Description", "description": "Description",
"strShort": "STR",
"dexShort": "DEX",
"intShort": "INT",
"powShort": "POW",
"conShort": "CON",
"chaShort": "CHA",
"strLong": "Strength",
"dexLong": "Dexterity",
"intLong": "Intelligence",
"powLong": "Power",
"conLong": "Constitution",
"chaLong": "Charisma",
"total": "Total", "total": "Total",
"skills": "Skills", "skills": "Skills",
"gear": "Gear",
"damage": "Damage", "damage": "Damage",
"resource": "Resource",
"armor": "Armor", "armor": "Armor",
"malus": "Malus", "malus": "Malus",
"experience": "Experience", "experience": "Experience",
@@ -518,53 +392,24 @@
"notes": "Notes", "notes": "Notes",
"weapons": "Weapons", "weapons": "Weapons",
"HP": "HP", "HP": "HP",
"SAN": "SAN",
"current": "Current", "current": "Current",
"max": "Max", "max": "Max",
"recovery": "Recovery",
"violence" : "Violence",
"helplessness": "Helplessness",
"breakingPoint": "Breaking Point",
"willpower": "Willpower",
"totalScore": "Total Score", "totalScore": "Total Score",
"exhausted": "Exhausted",
"skillRoll": "Skill Roll", "skillRoll": "Skill Roll",
"charRoll": "Characteristic Roll",
"finalScore": "Final Score", "finalScore": "Final Score",
"failure": "Failure", "failure": "Failure",
"success": "Success", "success": "Success",
"criticalSuccess": "Critical Success", "criticalSuccess": "Critical Success",
"criticalFailure": "Critical Failure", "criticalFailure": "Critical Failure",
"Characteristic": "Characteristic",
"characteristic": "Characteristic",
"targetScore": "Target Score", "targetScore": "Target Score",
"gears": "Gears",
"armors": "Armors", "armors": "Armors",
"motivations": "Motivations", "psionics": "Psionics",
"mentalDisorders": "Mental Disorders", "talents": "Talents",
"bonds": "Bonds", "languages": "Languages",
"arcane": "Arcane",
"archetypes": "Archetypes",
"bondType": "Bond Type",
"injuries": "Injuries",
"damageShort": "Dmg", "damageShort": "Dmg",
"status": "Status", "status": "Status",
"mentaldisorders": "Mental Disorders",
"newBond": "New Bond",
"newMotivation": "New Motivation",
"newMentalDisorder": "New Mental Disorder",
"newWeapon": "New Weapon", "newWeapon": "New Weapon",
"newArmor": "New Armor", "newArmor": "New Armor"
"newInjury": "New Injury",
"newGear": "New Gear",
"newArcane": "New Arcane",
"newArchetype": "New Archetype",
"newSkill": "New Skill",
"newTome": "New Tome",
"newRitual": "New Ritual"
},
"ChatMessage": {
"exhausted": "Your protagonist is exhausted. He loses [[/r 1d6]] Willpower Points."
}, },
"Edit": "Edit", "Edit": "Edit",
"Delete": "Delete", "Delete": "Delete",
@@ -575,21 +420,13 @@
"Roll": { "Roll": {
"skill": "Skill", "skill": "Skill",
"roll": "Roll", "roll": "Roll",
"applyNudge": "Apply", "cancel": "Cancel"
"cancel": "Cancel",
"nudgeRoll": "Nudge Roll"
}, },
"Tooltip": { "Tooltip": {
"sanBP": ">5 SAN lost in one roll, temporary insanity. If SAN less reaches BP = a Disorder unconscious Breaking and AND reset BP.",
"setBP": "Set the current Breaking Point based on the current SAN value"
}, },
"Chat": { "Chat": {
}, },
"Notifications": { "Notifications": {
"NoWeaponSkill": "No weapon skill found for this weapon. Check Weapon definition or available skills/era",
"NoWeaponType": "No weapon type found for this weapon subtype. Check Weapon definition or available skills/era",
"skillAlreadyExists": "Skill already exists",
"WrongEra": "The era of the item does not match the ear of the system"
} }
} }
} }

View File

@@ -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 FTLNomadTalentSheet } from "./sheets/talent-sheet.mjs"
export { default as FTLNomadCharacterSheet } from "./sheets/character-sheet.mjs" export { default as FTLNomadCharacterSheet } from "./sheets/character-sheet.mjs"
export { default as FTLNomadEquipmentSheet } from "./sheets/equipment-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 FTLNomadImplantSheet } from "./sheets/implant-sheet.mjs"
export { default as FTLNomadStarshipSheet } from "./sheets/starship-sheet.mjs" export { default as FTLNomadStarshipSheet } from "./sheets/starship-sheet.mjs"
export { default as FTLNomadCreatureTraitSheet } from "./sheets/creature-trait-sheet.mjs" export { default as FTLNomadCreatureTraitSheet } from "./sheets/creature-trait-sheet.mjs"

View File

@@ -15,13 +15,15 @@ export default class FTLNomadArmorSheet extends FTLNomadItemSheet {
/** @override */ /** @override */
static PARTS = { static PARTS = {
main: { main: {
template: "systems/fvtt-cthulhu-eternal/templates/armor.hbs", template: "systems/fvtt-ftl-nomad/templates/armor.hbs",
}, },
} }
/** @override */ /** @override */
async _prepareContext() { async _prepareContext() {
const context = await super._prepareContext() const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context return context
} }
} }

View File

@@ -1,6 +1,6 @@
import FTLNomadActorSheet from "./base-actor-sheet.mjs" import FTLNomadActorSheet from "./base-actor-sheet.mjs"
export default class FTLNomadNPCSheet extends FTLNomadActorSheet { export default class FTLNomadCreatureSheet extends FTLNomadActorSheet {
/** @override */ /** @override */
static DEFAULT_OPTIONS = { static DEFAULT_OPTIONS = {
classes: ["npc"], classes: ["npc"],
@@ -12,9 +12,9 @@ export default class FTLNomadNPCSheet extends FTLNomadActorSheet {
contentClasses: ["npc-content"], contentClasses: ["npc-content"],
}, },
actions: { actions: {
createArmor: FTLNomadNPCSheet.#onCreateArmor, createArmor: FTLNomadCreatureSheet.#onCreateArmor,
createWeapon: FTLNomadNPCSheet.#onCreateWeapon, createWeapon: FTLNomadCreatureSheet.#onCreateWeapon,
createSkill: FTLNomadNPCSheet.#onCreateSkill, createSkill: FTLNomadCreatureSheet.#onCreateSkill,
}, },
} }
@@ -22,16 +22,16 @@ export default class FTLNomadNPCSheet extends FTLNomadActorSheet {
/** @override */ /** @override */
static PARTS = { static PARTS = {
main: { main: {
template: "systems/fvtt-cthulhu-eternal/templates/npc-main.hbs", template: "systems/fvtt-ftl-nomad/templates/creature-main.hbs",
}, },
tabs: { tabs: {
template: "templates/generic/tab-navigation.hbs", template: "templates/generic/tab-navigation.hbs",
}, },
skills: { skills: {
template: "systems/fvtt-cthulhu-eternal/templates/npc-skills.hbs", template: "systems/fvtt-ftl-nomad/templates/creature-skills.hbs",
}, },
biography: { biography: {
template: "systems/fvtt-cthulhu-eternal/templates/npc-biography.hbs", template: "systems/fvtt-ftl-nomad/templates/creature-biography.hbs",
}, },
} }

View File

@@ -15,13 +15,14 @@ export default class FTLNomadEquipmentSheet extends FTLNomadItemSheet {
/** @override */ /** @override */
static PARTS = { static PARTS = {
main: { main: {
template: "systems/fvtt-cthulhu-eternal/templates/equipment.hbs", template: "systems/fvtt-ftl-nomad/templates/equipment.hbs",
}, },
} }
/** @override */ /** @override */
async _prepareContext() { async _prepareContext() {
const context = await super._prepareContext() const context = await super._prepareContext()
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
return context return context
} }
} }

View File

@@ -15,7 +15,7 @@ export default class FTLNomadImplantSheet extends FTLNomadItemSheet {
/** @override */ /** @override */
static PARTS = { static PARTS = {
main: { main: {
template: "systems/fvtt-cthulhu-eternal/templates/implant.hbs", template: "systems/fvtt-ftl-nomad/templates/implant.hbs",
}, },
} }

View File

@@ -15,7 +15,7 @@ export default class FTLNomadLanguageSheet extends FTLNomadItemSheet {
/** @override */ /** @override */
static PARTS = { static PARTS = {
main: { main: {
template: "systems/fvtt-cthulhu-eternal/templates/language.hbs", template: "systems/fvtt-ftl-nomad/templates/language.hbs",
}, },
} }

View File

@@ -15,7 +15,7 @@ export default class FTLNomadPsionicSheet extends FTLNomadItemSheet {
/** @override */ /** @override */
static PARTS = { static PARTS = {
main: { main: {
template: "systems/fvtt-cthulhu-eternal/templates/psionic.hbs", template: "systems/fvtt-ftl-nomad/templates/psionic.hbs",
}, },
} }

View File

@@ -15,7 +15,7 @@ export default class FTLNomadWeaponSheet extends FTLNomadItemSheet {
/** @override */ /** @override */
static PARTS = { static PARTS = {
main: { main: {
template: "systems/fvtt-cthulhu-eternal/templates/weapon.hbs", template: "systems/fvtt-ftl-nomad/templates/weapon.hbs",
}, },
} }
} }

View File

@@ -1,29 +1,18 @@
export const SYSTEM_ID = "fvtt-ftl-nomad" export const SYSTEM_ID = "fvtt-ftl-nomad"
export const ASCII = ` export const ASCII = `
░ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░░▌ ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌ ░▒▓████████▓▒░▒▓████████▓▒░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░░▒▓██████████████▓▒░ ░▒▓██████▓▒░░▒▓███████▓▒░
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀ ▐░▌ ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌░▌ ▐░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ░▒▓██████▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀█░█▀▀ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓██▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓████████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░
▐░▌ ▐░▌ ▐░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▄▄▄▄█░█▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌
▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀
▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ `
▐░░▌ ▐░▌▐░░░░░░░░░░░▌▐░░▌ ▐░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌
▐░▌░▌ ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌░▌ ▐░▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌
▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌ ▐░▌
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▀ ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌
▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌
▐░▌ ▐░▐░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌
▐░▌ ▐░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░░░░░░░░░░▌
▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀
`
export const SKILLS = { export const SKILLS = {
"combat": { id: "combat", label: "FTLNOMAD.Skill.Combat" }, "combat": { id: "combat", label: "FTLNOMAD.Skill.Combat" },
@@ -52,11 +41,61 @@ export const TECH_AGES = {
"cosmic": { id: "cosmic", label: "FTLNOMAD.TechAge.Cosmic", level: 13 } "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 = { export const WEAPON_RANGE = {
"melee": { id: "melee", label: "FTLNOMAD.Weapon.Range.Melee" }, "melee": { id: "melee", label: "FTLNOMAD.Weapon.Range.Melee" },
"handgun": { id: "handgun", label: "FTLNOMAD.Weapon.Range.Handgun" }, "handgun": { id: "handgun", label: "FTLNOMAD.Weapon.Range.Handgun" },
"rifle": { id: "rifle", label: "FTLNOMAD.Weapon.Range.Rifle" }, "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 = { export const SYSTEM = {
id: SYSTEM_ID, id: SYSTEM_ID,
TECH_AGES, TECH_AGES,
WEAPON_TYPES,
WEAPON_RANGE, WEAPON_RANGE,
TRIAGE_RESULTS,
CREATURE_TERRAIN_TYPES,
CREATURE_SIZES,
SKILLS, SKILLS,
ASCII ASCII
} }

View File

@@ -7,7 +7,7 @@ export default class FTLNomadArmor extends foundry.abstract.TypeDataModel {
schema.description = new fields.HTMLField({ required: true, textSearch: true }) 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.protection = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.enc = 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 }) schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })

View File

@@ -17,7 +17,7 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
// Carac // Carac
const skillField = (label) => { const skillField = (label) => {
const schema = { 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 }) 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 }), value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
max: new fields.NumberField({ ...requiredInteger, initial: 3, min: 0 }), max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
exhausted: new fields.BooleanField({ required: true, initial: false })
}) })
schema.hp = new fields.SchemaField({ schema.credits = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }), schema.rank = new fields.SchemaField({
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }), experienced: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
stunned: new fields.BooleanField({ required: true, initial: false }) 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 }),
schema.san = new fields.SchemaField({ legend: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 })
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.biodata = new fields.SchemaField({ schema.biodata = new fields.SchemaField({
age: new fields.NumberField({ ...requiredInteger, initial: 15, min: 6 }), 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 }), height: new fields.NumberField({ ...requiredInteger, initial: 170, min: 50 }),
gender: new fields.StringField({ required: true, nullable: false, initial: "" }), gender: new fields.StringField({ required: true, nullable: false, initial: "" }),
home: 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: "" }), birthplace: new fields.StringField({ required: true, nullable: false, initial: "" }),
eyes: 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: "" }), 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 })
}) })
return schema return schema
} }
/** @override */ /** @override */
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Protagonist"] static LOCALIZATION_PREFIXES = ["FTLNOMAD.Character"]
prepareDerivedData() { prepareDerivedData() {
super.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({ let roll = await CthulhuEternalRoll.prompt({
rollType, rollType,
rollItem, rollItem,
isLowWP: this.isLowWP(),
isZeroWP: this.isZeroWP(),
isExhausted: this.isExhausted(),
actorId: this.parent.id, actorId: this.parent.id,
actorName: this.parent.name, actorName: this.parent.name,
actorImage: this.parent.img, actorImage: this.parent.img,

View File

@@ -5,12 +5,12 @@ export default class FTLNomadCreatureAbility extends foundry.abstract.TypeDataMo
const fields = foundry.data.fields; const fields = foundry.data.fields;
const schema = {}; 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 }) schema.description = new fields.HTMLField({ required: true, textSearch: true })
return schema; return schema;
} }
/** @override */ /** @override */
static LOCALIZATION_PREFIXES = ["FTLNomad.CreatureAbility"]; static LOCALIZATION_PREFIXES = ["FTLNOMAD.CreatureAbility"];
} }

View File

@@ -5,12 +5,12 @@ export default class FTLNomadCreatureTrait extends foundry.abstract.TypeDataMode
const fields = foundry.data.fields; const fields = foundry.data.fields;
const schema = {}; 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 }) schema.description = new fields.HTMLField({ required: true, textSearch: true })
return schema; return schema;
} }
/** @override */ /** @override */
static LOCALIZATION_PREFIXES = ["FTLNomad.CreatureTrait"]; static LOCALIZATION_PREFIXES = ["FTLNOMAD.CreatureTrait"];
} }

View File

@@ -7,38 +7,31 @@ export default class FTLNomadCreature extends foundry.abstract.TypeDataModel {
const requiredInteger = { required: true, nullable: false, integer: true } const requiredInteger = { required: true, nullable: false, integer: true }
const schema = {} const schema = {}
// Carac const skillField = (label) => {
const characteristicField = (label) => {
const schema = { const schema = {
value: new fields.NumberField({ ...requiredInteger, initial: 3, min: 0 }), value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
feature: new fields.StringField({ required: true, nullable: false, initial: "" }) enabled: new fields.BooleanField({ required: true, initial: true }),
} }
return new fields.SchemaField(schema, { label }) return new fields.SchemaField(schema, { label })
} }
schema.characteristics = new fields.SchemaField( schema.skills = new fields.SchemaField(
Object.values(SYSTEM.CHARACTERISTICS).reduce((obj, characteristic) => { Object.values(SYSTEM.SKILLS).reduce((obj, characteristic) => {
obj[characteristic.id] = characteristicField(characteristic.label) obj[characteristic.id] = skillField(characteristic.label)
return obj return obj
}, {}), }, {}),
) )
schema.wp = new fields.SchemaField({ schema.terrain = new fields.StringField({ required: true, nullable: false, initial: "cave", choices: SYSTEM.CREATURE_TERRAIN_TYPES })
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }), schema.niche = new fields.StringField({ required: true, nullable: false, initial: "prey", choices: SYSTEM.CREATURE_NICHES })
max: new fields.NumberField({ ...requiredInteger, initial: 3, min: 0 }), schema.size = new fields.StringField({ required: true, nullable: false, initial: "small", choices: SYSTEM.CREATURE_SIZES })
exhausted: new fields.BooleanField({ required: true, initial: false })
})
schema.hp = new fields.SchemaField({ schema.numberAppearing = new fields.StringField({ required: true, initial: "1d6" })
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }), schema.health = new fields.SchemaField({
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }) 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.damage = new fields.StringField({ required: true, initial: "1d6" })
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.description = new fields.HTMLField({ required: true, textSearch: true }) schema.description = new fields.HTMLField({ required: true, textSearch: true })
schema.notes = 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 */ /** @override */
static LOCALIZATION_PREFIXES = ["FTLNOMAD.NPC"] static LOCALIZATION_PREFIXES = ["FTLNOMAD.Creature"]
/** */ /** */
/** /**

View File

@@ -8,7 +8,7 @@ export default class FTLNomadEquipment extends foundry.abstract.TypeDataModel {
schema.description = new fields.HTMLField({ required: true, textSearch: true }) 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.enc = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 }) schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })

View File

@@ -8,7 +8,7 @@ export default class FTLNomadImplant extends foundry.abstract.TypeDataModel {
schema.description = new fields.HTMLField({ required: true, textSearch: true }) 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.enc = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 }) schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })

View File

@@ -26,6 +26,6 @@ export default class FTLNomadStarship extends foundry.abstract.TypeDataModel {
} }
/** @override */ /** @override */
static LOCALIZATION_PREFIXES = ["FTLNomad.Starship"] static LOCALIZATION_PREFIXES = ["FTLNOMAD.Starship"]
} }

View File

@@ -5,7 +5,7 @@ export default class FTLNomadTalent extends foundry.abstract.TypeDataModel {
const fields = foundry.data.fields; const fields = foundry.data.fields;
const schema = {}; 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 }) schema.description = new fields.HTMLField({ required: true, textSearch: true })
@@ -13,5 +13,5 @@ export default class FTLNomadTalent extends foundry.abstract.TypeDataModel {
} }
/** @override */ /** @override */
static LOCALIZATION_PREFIXES = ["FTLNomad.Talent"]; static LOCALIZATION_PREFIXES = ["FTLNOMAD.Talent"];
} }

View File

@@ -7,19 +7,18 @@ export default class FTLNomadVehicle extends foundry.abstract.TypeDataModel {
const requiredInteger = { required: true, nullable: false, integer: true } const requiredInteger = { required: true, nullable: false, integer: true }
const schema = {} const schema = {}
schema.hp = new fields.SchemaField({ schema.agility = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }), schema.armor = new fields.StringField({ required: true, initial: "" })
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }) 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.cost = new fields.NumberField({ required: true, 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.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.description = new fields.HTMLField({ required: true, textSearch: true })
schema.notes = 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 */ /** @override */
static LOCALIZATION_PREFIXES = ["FTLNomad.Vehicle"] static LOCALIZATION_PREFIXES = ["FTLNOMAD.Vehicle"]
} }

View File

@@ -7,7 +7,9 @@ export default class FTLNomadWeapon extends foundry.abstract.TypeDataModel {
const requiredInteger = { required: true, nullable: false, integer: true } const requiredInteger = { required: true, nullable: false, integer: true }
schema.description = new fields.HTMLField({ required: true, textSearch: 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.rangeType = new fields.StringField({ required: true, initial: "melee", choices: SYSTEM.WEAPON_RANGE })
schema.damage = new fields.StringField({required: true, initial: "1d6"}) schema.damage = new fields.StringField({required: true, initial: "1d6"})

View File

@@ -10,6 +10,7 @@
@import "weapon.less"; @import "weapon.less";
@import "armor.less"; @import "armor.less";
@import "equipment.less"; @import "equipment.less";
@import "implant.less";
@import "language.less"; @import "language.less";
@import "psionic.less"; @import "psionic.less";
@import "talent.less"; @import "talent.less";

View File

@@ -6,20 +6,15 @@
<fieldset> <fieldset>
{{formField systemFields.techAge value=system.techAge localize=true}} {{formField systemFields.techAge value=system.techAge localize=true}}
{{formField systemFields.cost value=system.cost}} {{formField systemFields.protection value=system.protection}}
{{formField systemFields.enc value=system.enc}} {{formField systemFields.enc value=system.enc}}
{{formField systemFields.cost value=system.cost}} {{formField systemFields.cost value=system.cost}}
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>{{localize "FTLNOMAD.Label.description"}}</legend> <legend>{{localize "FTLNOMAD.Label.description"}}</legend>
{{formInput {{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description"
systemFields.description toggled=true}}
enriched=description
value=system.description
name="system.description"
toggled="false"
}}
</fieldset> </fieldset>
</section> </section>

View File

@@ -5,17 +5,13 @@
</div> </div>
<fieldset> <fieldset>
{{formField systemFields.cured value=system.cured localize=true}} {{formField systemFields.isAdvantage value=system.isAdvantage}}
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>{{localize "FTLNOMAD.Label.description"}}</legend> <legend>{{localize "FTLNOMAD.Label.description"}}</legend>
{{formInput {{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description"
systemFields.description toggled=true}}
enriched=description
value=system.description
name="system.description"
toggled="false"
}}
</fieldset> </fieldset>
</section> </section>

View File

@@ -5,7 +5,7 @@
</div> </div>
<fieldset> <fieldset>
{{formField systemFields.cured value=system.cured localize=true}} {{formField systemFields.isAdvantage value=system.isAdvantage}}
</fieldset> </fieldset>
<fieldset> <fieldset>

View File

@@ -5,7 +5,9 @@
</div> </div>
<fieldset> <fieldset>
{{formField systemFields.isAdvantage value=system.isAdvantage}} {{formField systemFields.techAge value=system.techAge localize=true}}
{{formField systemFields.enc value=system.enc}}
{{formField systemFields.cost value=system.cost}}
</fieldset> </fieldset>
<fieldset> <fieldset>

View File

@@ -5,12 +5,15 @@
</div> </div>
<fieldset> <fieldset>
{{formField systemFields.techAge value=system.techAge localize=true}}
{{formField systemFields.enc value=system.enc}}
{{formField systemFields.cost value=system.cost}}
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>{{localize "FTLNOMAD.Label.description"}}</legend> <legend>{{localize "FTLNOMAD.Label.description"}}</legend>
{{formInput systemFields.description enriched=description value=system.description name="system.description" toggled=true}} {{formInput systemFields.description enriched=description value=system.description name="system.description"
toggled=true}}
</fieldset> </fieldset>
</section> </section>

View File

@@ -6,7 +6,8 @@
<fieldset> <fieldset>
{{formField systemFields.techAge value=system.techAge localize=true}} {{formField systemFields.techAge value=system.techAge localize=true}}
{{formField systemFields.n value=system.rangeType localize=true}} {{formField systemFields.weaponType value=system.weaponType localize=true}}
{{formField systemFields.rangeType value=system.rangeType localize=true}}
{{formField systemFields.damage value=system.damage}} {{formField systemFields.damage value=system.damage}}
{{formField systemFields.enc value=system.enc}} {{formField systemFields.enc value=system.enc}}