-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
1,343 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { | ||
attributes, | ||
characteristics, | ||
} from '../common.js' | ||
|
||
import { | ||
makeIntField, | ||
makeBoolField, | ||
makeStringField, | ||
makeHtmlField | ||
} from '../helpers.js' | ||
|
||
export default class CharacterDataModel extends foundry.abstract.DataModel { | ||
static defineSchema() { | ||
const type = 'character' | ||
|
||
return { | ||
description: makeHtmlField(), | ||
enrichedDescription: makeHtmlField(), | ||
attributes: attributes(), | ||
characteristics: characteristics(type), | ||
isPC: makeBoolField(true), | ||
level: makeIntField(), | ||
ancestry: makeStringField(), // Unused | ||
religion: new foundry.data.fields.SchemaField({ | ||
edit: makeBoolField(), | ||
value: makeStringField(), | ||
image: makeStringField('systems/demonlord/assets/icons/bird.webp') | ||
}), | ||
languages: new foundry.data.fields.SchemaField({ | ||
edit: makeBoolField(), | ||
value: makeStringField() | ||
}), | ||
wealth: new foundry.data.fields.SchemaField({ | ||
edit: makeBoolField(), | ||
lifestyle: makeStringField(), | ||
description: makeStringField(), | ||
bits: makeIntField(), | ||
cp: makeIntField(), | ||
ss: makeIntField(), | ||
gc: makeIntField() | ||
}), | ||
// Unused | ||
professions: new foundry.data.fields.SchemaField({ | ||
edit: makeBoolField(), | ||
value: makeStringField() | ||
}), | ||
// Unused | ||
features: new foundry.data.fields.SchemaField({ | ||
edit: makeBoolField() | ||
}), | ||
// Unused | ||
paths: new foundry.data.fields.SchemaField({ | ||
edit: makeBoolField(), | ||
novice: makeStringField(), | ||
expert: makeStringField(), | ||
master: makeStringField(), | ||
legendary: makeStringField() | ||
}), | ||
appearance: new foundry.data.fields.SchemaField({ | ||
age: makeStringField(), | ||
sex: makeStringField(), | ||
eyes: makeStringField(), | ||
hair: makeStringField(), | ||
height: makeStringField(), | ||
weight: makeStringField(), | ||
feature: makeStringField(), | ||
}), | ||
gmnote: makeStringField(), | ||
gmnoteedit: makeBoolField(), | ||
} | ||
} | ||
|
||
get type() { | ||
return 'character' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
attributes, | ||
characteristics, | ||
} from '../common.js' | ||
|
||
import { | ||
makeIntField, | ||
makeBoolField, | ||
makeStringField, | ||
makeHtmlField | ||
} from '../helpers.js' | ||
|
||
export default class CreatureDataModel extends foundry.abstract.DataModel { | ||
static defineSchema() { | ||
const type = 'creature' | ||
|
||
return { | ||
description: makeHtmlField(), | ||
enrichedDescription: makeHtmlField(), | ||
attributes: attributes(), | ||
characteristics: characteristics(type), | ||
|
||
difficulty: makeIntField(), | ||
frightening: makeBoolField(), | ||
horrifying: makeBoolField(), | ||
descriptor: makeStringField(), | ||
perceptionsenses: makeStringField(), | ||
speedtraits: makeStringField(), | ||
armor: makeStringField(), | ||
roles: new foundry.data.fields.ArrayField(makeStringField()) // ? | ||
} | ||
} | ||
|
||
get type() { | ||
return 'creature' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { | ||
attributes, | ||
characteristics, | ||
} from '../common.js' | ||
|
||
import { | ||
makeIntField, | ||
makeStringField, | ||
makeHtmlField | ||
} from '../helpers.js' | ||
|
||
export default class VehicleDataModel extends foundry.abstract.DataModel { | ||
static defineSchema() { | ||
const type = 'vehicle' | ||
|
||
return { | ||
description: makeHtmlField(), | ||
enrichedDescription: makeHtmlField(), | ||
attributes: attributes(), | ||
characteristics: characteristics(type), | ||
|
||
descriptor: makeStringField(), | ||
speedtraits: makeStringField(), | ||
price: makeStringField(), | ||
cargo: makeIntField() | ||
} | ||
} | ||
|
||
get type() { | ||
return 'vehicle' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import { makeBoolField, makeIntField, makeStringField, makeAttribute, makeHealth, makeInsanity, makeCorruption } from './helpers.js' | ||
|
||
export function attributes() { | ||
return new foundry.data.fields.SchemaField({ | ||
strength: makeAttribute('strength'), | ||
agility: makeAttribute('agility'), | ||
intellect: makeAttribute('intellect'), | ||
will: makeAttribute('will'), | ||
perception: makeAttribute('perception') | ||
}) | ||
} | ||
|
||
export function characteristics() { | ||
return new foundry.data.fields.SchemaField({ | ||
defense: makeIntField(), | ||
health: makeHealth(), | ||
insanity: makeInsanity(), | ||
corruption: makeCorruption(), | ||
power: makeIntField(), | ||
size: makeStringField(), | ||
speed: makeIntField(10), | ||
fortune: makeIntField() | ||
}) | ||
} | ||
|
||
export function action() { | ||
return new foundry.data.fields.SchemaField({ | ||
active: makeBoolField(true), | ||
attribute: makeStringField(), | ||
against: makeStringField(), | ||
damageactive: makeBoolField(true), | ||
damage: makeStringField(), | ||
damagetype: makeStringField(), | ||
boonsbanesactive: makeBoolField(true), | ||
boonsbanes: makeStringField(), | ||
plus20active: makeBoolField(true), | ||
plus20: makeStringField(), | ||
plus20damage: makeStringField(), | ||
defense: makeStringField(), | ||
defenseboonsbanes: makeStringField(), | ||
damagetypes: new foundry.data.fields.ArrayField(makeStringField()), | ||
strengthboonsbanesselect: makeBoolField(), | ||
agilityboonsbanesselect: makeBoolField(), | ||
intellectboonsbanesselect: makeBoolField(), | ||
willboonsbanesselect: makeBoolField(), | ||
perceptionboonsbanesselect: makeBoolField(), | ||
extraboonsbanes: makeStringField(), | ||
extradamage: makeStringField(), | ||
extraplus20damage: makeStringField(), | ||
extraeffect: makeStringField() | ||
}) | ||
} | ||
|
||
export function activatedEffect() { | ||
return new foundry.data.fields.SchemaField({ | ||
activation: new foundry.data.fields.SchemaField({ | ||
type: makeStringField(), | ||
cost: makeIntField() | ||
}), | ||
duration: new foundry.data.fields.SchemaField({ | ||
value: makeIntField(), | ||
type: makeStringField() | ||
}), | ||
target: new foundry.data.fields.SchemaField({ | ||
value: makeStringField(), | ||
type: makeStringField() | ||
}), | ||
texture: makeStringField(), | ||
range: makeStringField(), | ||
uses: new foundry.data.fields.SchemaField({ | ||
value: makeIntField(), | ||
max: makeIntField(), | ||
per: makeStringField() | ||
}) | ||
}) | ||
} | ||
|
||
export function enchantment() { | ||
return new foundry.data.fields.SchemaField({ | ||
attackbonus: makeIntField(), | ||
challengebonuse: makeIntField(), | ||
damage: makeStringField(), | ||
defense: makeIntField(), | ||
speed: makeIntField(), | ||
perception: makeIntField(), | ||
effect: makeStringField(), | ||
uses: new foundry.data.fields.SchemaField({ | ||
value: makeIntField(), | ||
max: makeIntField() | ||
}) | ||
}) | ||
} | ||
|
||
export function contents() { | ||
return new foundry.data.fields.ArrayField(makeStringField()) | ||
} | ||
|
||
export function levelItem(makeDataSchema) { | ||
return new foundry.data.fields.SchemaField({ | ||
system: makeDataSchema(), | ||
description: new foundry.data.fields.SchemaField({ | ||
value: makeStringField() | ||
}), | ||
id: makeStringField(), | ||
name: makeStringField(), | ||
pack: makeStringField(), | ||
selected: makeBoolField(), | ||
uuid: makeStringField() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { capitalize } from "../utils/utils" | ||
|
||
export const makeBoolField = (init = false) => new foundry.data.fields.BooleanField({ | ||
initial: init | ||
}) | ||
|
||
export const makeNumberField = (init = 1, max = 20, min = 0) => new foundry.data.fields.NumberField({ | ||
required: true, | ||
initial: init, | ||
//positive: true | ||
min: min, | ||
max: max, | ||
}) | ||
|
||
export const makeIntField = (init = 0, max = 20, min = 0) => new foundry.data.fields.NumberField({ | ||
required: true, | ||
initial: init, | ||
min: min, | ||
max: max, | ||
integer: true, | ||
clean: true | ||
}) | ||
|
||
export const makeStringField = (init = '', blank = true) => new foundry.data.fields.StringField({ | ||
initial: init, | ||
blank: blank | ||
}) | ||
|
||
export const makeHtmlField = (init = '') => new foundry.data.fields.SchemaField({ | ||
value: new foundry.data.fields.HTMLField({ | ||
initial: init, | ||
textSearch: true // Allow it to be searched in the Search Bar | ||
}) | ||
}) | ||
|
||
export function makeAttribute(attribute) { | ||
return new foundry.data.fields.SchemaField({ | ||
key: makeStringField(attribute), | ||
label: makeStringField(game.i18n.localize(`DL.Attribute${capitalize(attribute)}`)), | ||
value: makeIntField(10), | ||
modifier: makeIntField(), | ||
min: makeIntField(), | ||
max: makeIntField(20), | ||
immune: makeBoolField() | ||
}) | ||
} | ||
|
||
export function makeHealth() { | ||
return new foundry.data.fields.SchemaField({ | ||
max: makeIntField(), | ||
value: makeIntField(), | ||
injured: makeBoolField(), | ||
healingrate: makeIntField() | ||
}) | ||
} | ||
|
||
export function makeInsanity() { | ||
return new foundry.data.fields.SchemaField({ | ||
min: makeIntField(), | ||
max: makeIntField(20), | ||
value: makeIntField(), | ||
immune: makeBoolField() | ||
}) | ||
} | ||
|
||
export function makeCorruption() { | ||
return new foundry.data.fields.SchemaField({ | ||
min: makeIntField(), | ||
value: makeIntField(), | ||
immune: makeBoolField() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
import { | ||
makeIntField, | ||
makeStringField, | ||
makeHtmlField, | ||
} from '../helpers.js' | ||
|
||
export default class AmmoDataModel extends foundry.abstract.DataModel { | ||
static defineSchema() { | ||
return { | ||
description: makeHtmlField(), | ||
enrichedDescription: makeHtmlField(), | ||
properties: makeStringField(), | ||
quantity: makeIntField(5), | ||
availability: makeStringField(), | ||
value: makeStringField() | ||
} | ||
} | ||
} |
Oops, something went wrong.