Add starship, creature and vehicle
This commit is contained in:
@@ -97,6 +97,10 @@ export default class FTLNomadProtagonist extends foundry.abstract.TypeDataModel
|
||||
if (armor !== this.armor.value) {
|
||||
this.armor.value = armor
|
||||
}
|
||||
let staminaMax = 14 + (3*this.skills.physical.value)
|
||||
if (staminaMax !== this.health.staminaMax) {
|
||||
this.health.staminaMax = staminaMax
|
||||
}
|
||||
}
|
||||
|
||||
isEncumbered() {
|
||||
|
||||
@@ -7,9 +7,11 @@ export default class FTLNomadCreature extends foundry.abstract.TypeDataModel {
|
||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||
const schema = {}
|
||||
|
||||
// Carac
|
||||
const skillField = (label) => {
|
||||
const schema = {
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 5 }),
|
||||
label: new fields.StringField({ required: true, nullable: false, initial: label }),
|
||||
enabled: new fields.BooleanField({ required: true, initial: true }),
|
||||
}
|
||||
return new fields.SchemaField(schema, { label })
|
||||
@@ -42,32 +44,29 @@ export default class FTLNomadCreature extends foundry.abstract.TypeDataModel {
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Creature"]
|
||||
|
||||
/** */
|
||||
/**
|
||||
* Rolls a dice for a character.
|
||||
* @param {("save"|"resource|damage")} rollType The type of the roll.
|
||||
* @param {number} rollItem The target value for the roll. Which caracteristic or resource. If the roll is a damage roll, this is the id of the item.
|
||||
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
||||
*/
|
||||
async roll(rollType, rollItem) {
|
||||
let opponentTarget
|
||||
const hasTarget = opponentTarget !== undefined
|
||||
|
||||
let roll = await CthulhuEternalRoll.prompt({
|
||||
rollType,
|
||||
rollItem,
|
||||
isLowWP: false,
|
||||
isZeroWP: false,
|
||||
isExhausted: false,
|
||||
actorId: this.parent.id,
|
||||
actorName: this.parent.name,
|
||||
actorImage: this.parent.img,
|
||||
hasTarget,
|
||||
target: opponentTarget
|
||||
})
|
||||
if (!roll) return null
|
||||
|
||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
||||
}
|
||||
|
||||
isEncumbered() {
|
||||
return false
|
||||
}
|
||||
|
||||
async roll(rollType, rollItem) {
|
||||
let opponentTarget
|
||||
const hasTarget = opponentTarget !== undefined
|
||||
|
||||
let roll = await FTLNomadRoll.prompt({
|
||||
rollType,
|
||||
rollItem,
|
||||
actorId: this.parent.id,
|
||||
actorName: this.parent.name,
|
||||
actorImage: this.parent.img,
|
||||
traits: this.parent.items.filter(i => i.type === "creature-trait" && i.system.isAdvantage),
|
||||
abilities: this.parent.items.filter(i => i.type === "creature-ability" && i.system.isAdvantage),
|
||||
isEncumbered: this.isEncumbered(),
|
||||
hasTarget,
|
||||
target: opponentTarget
|
||||
})
|
||||
if (!roll) return null
|
||||
|
||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,4 +28,8 @@ export default class FTLNomadStarship extends foundry.abstract.TypeDataModel {
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Starship"]
|
||||
|
||||
isEncumbered() {
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export default class FTLNomadVehicle extends foundry.abstract.TypeDataModel {
|
||||
const schema = {}
|
||||
|
||||
schema.agility = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
schema.armor = new fields.StringField({ required: true, initial: "" })
|
||||
schema.armor = new fields.StringField({ required: true, initial: 0, 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 })
|
||||
@@ -28,4 +28,8 @@ export default class FTLNomadVehicle extends foundry.abstract.TypeDataModel {
|
||||
/** @override */
|
||||
static LOCALIZATION_PREFIXES = ["FTLNOMAD.Vehicle"]
|
||||
|
||||
isEncumbered() {
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user