forked from foundryvtt/dnd5e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
empire-des-cerisiers.mjs
144 lines (123 loc) · 4.53 KB
/
empire-des-cerisiers.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/**
* The DnD5e game system for Foundry Virtual Tabletop
* A system for playing the fifth edition of the world's most popular role-playing game.
* Author: Atropos
* Software License: MIT
* Content License: https://www.dndbeyond.com/attachments/39j2li89/SRD5.1-CCBY4.0License.pdf
* Repository: https://github.com/foundryvtt/dnd5e
* Issue Tracker: https://github.com/foundryvtt/dnd5e/issues
*/
// Import Configuration
import EDC from "./module/config.mjs";
import registerSystemSettings from "./module/settings.mjs";
// Import Submodules
// import * as applications from "./module/applications/_module.mjs";
// import * as dataModels from "./module/data/_module.mjs";
// import * as documents from "./module/documents/_module.mjs";
import { PlayerActor } from "./scripts/characters/player.js";
import { PlayerActorSheet } from "./scripts/characters/player-sheet.js";
import { PlayerActorSheetDND } from "./scripts/characters/player-sheet-dnd.js";
import { preloadHandlebarsTemplates, registerHandlebarsHelpers } from "./scripts/handlebars.js";
/* -------------------------------------------- */
/* Define Module Structure */
/* -------------------------------------------- */
globalThis.edc = {
// applications,
config: EDC,
// dataModels,
// documents
};
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("init", function() {
console.log(`Empire des Cerisiers | Initializing the EDC Game System`);
// Record Configuration Values
CONFIG.EDC = EDC;
CONFIG.Actor.documentClass = PlayerActor;
// CONFIG.Item.documentClass = documents.ItemEDC;
game.isV10 = game.release.generation < 11;
// Configure trackable attributes.
// _configureTrackableAttributes();
// Register System Settings
registerSystemSettings();
// Hook up system data types
// const modelType = game.dnd5e.isV10 ? "systemDataModels" : "dataModels";
// CONFIG.Actor[modelType] = dataModels.actor.config;
// CONFIG.Item[modelType] = dataModels.item.config;
// CONFIG.JournalEntryPage[modelType] = dataModels.journal.config;
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("empire-des-cerisiers", PlayerActorSheet, {
types: ["character", "player"],
makeDefault: true,
label: "DND5E.SheetClassCharacter"
});
Actors.registerSheet("empire-des-cerisiers", PlayerActorSheetDND, {
types: ["character", "player"],
makeDefault: false,
label: "DND5E.SECOND_TEST"
});
// Items.unregisterSheet("core", ItemSheet);
// Items.registerSheet("empire-des-cerisiers", applications.item.ItemSheet5e, {
// makeDefault: true,
// label: "DND5E.SheetClassItem"
// });
// DocumentSheetConfig.registerSheet(JournalEntryPage, "empire-des-cerisiers", applications.journal.JournalClassPageSheet, {
// label: "DND5E.SheetClassClassSummary",
// types: ["class"]
// });
// Preload Handlebars helpers & partials
registerHandlebarsHelpers();
preloadHandlebarsTemplates();
});
/**
* Configure explicit lists of attributes that are trackable on the token HUD and in the combat tracker.
* @internal
*/
function _configureTrackableAttributes() {
const common = {
bar: [],
value: [
...Object.keys(DND5E.abilities).map(ability => `abilities.${ability}.value`),
...Object.keys(DND5E.movementTypes).map(movement => `attributes.movement.${movement}`),
"attributes.ac.value", "attributes.init.total"
]
};
const creature = {
bar: [...common.bar, "attributes.hp"],
value: [
...common.value,
...Object.keys(DND5E.skills).map(skill => `skills.${skill}.passive`),
...Object.keys(DND5E.senses).map(sense => `attributes.senses.${sense}`),
"attributes.spelldc"
]
};
CONFIG.Actor.trackableAttributes = {
character: {
bar: [...creature.bar, "resources.primary", "resources.secondary", "resources.tertiary", "details.xp"],
value: [...creature.value]
},
npc: {
bar: [...creature.bar, "resources.legact", "resources.legres"],
value: [...creature.value, "details.cr", "details.spellLevel", "details.xp.value"]
},
vehicle: {
bar: [...common.bar, "attributes.hp"],
value: [...common.value]
},
group: {
bar: [],
value: []
}
};
}
/* -------------------------------------------- */
/* Bundled Module Exports */
/* -------------------------------------------- */
export {
// applications,
// dataModels,
// documents,
EDC
};