forked from SolarBear/Numenera-FoundryVTT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnumenera.js
84 lines (71 loc) · 4.46 KB
/
numenera.js
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
import { NumeneraActor } from './module/actor/NumeneraActor.js';
import { NumeneraCommunityActorSheet } from './module/actor/sheets/NumeneraCommunityActorSheet.js';
import { NumeneraNPCActorSheet } from './module/actor/sheets/NumeneraNPCActorSheet.js';
import { NumeneraPCActorSheet } from './module/actor/sheets/NumeneraPCActorSheet.js';
import { NumeneraItem } from './module/item/NumeneraItem.js';
import { NumeneraAbilityItemSheet } from './module/item/sheets/NumeneraAbilityItemSheet.js';
import { NumeneraArmorItemSheet } from './module/item/sheets/NumeneraArmorItemSheet.js';
import { NumeneraArtifactItemSheet } from './module/item/sheets/NumeneraArtifactItemSheet.js';
import { NumeneraCypherItemSheet } from './module/item/sheets/NumeneraCypherItemSheet.js';
import { NumeneraEquipmentItemSheet } from './module/item/sheets/NumeneraEquipmentItemSheet.js';
import { NumeneraOddityItemSheet } from './module/item/sheets/NumeneraOddityItemSheet.js';
import { NumeneraSkillItemSheet } from './module/item/sheets/NumeneraSkillItemSheet.js';
import { NumeneraWeaponItemSheet } from './module/item/sheets/NumeneraWeaponItemSheet.js';
import { StrangeRecursionItemSheet } from './module/item/sheets/StrangeRecursionItemSheet.js';
import { NUMENERA } from './module/config.js';
import { getInitiativeFormula, rollInitiative } from './module/combat.js';
import { preloadHandlebarsTemplates } from './module/templates.js';
import { registerSystemSettings } from './module/settings.js';
import { migrateWorld } from './module/migrations/migrate.js';
import { numeneraSocketListeners } from './module/socket.js';
import { RecoveryDialog } from './module/apps/RecoveryDialog.js';
import { registerHandlebarHelpers } from './module/handlebarHelpers.js';
import { add3rdBarToPCTokens, cypherToken } from './module/token.js';
import { registerHooks } from './module/hooks.js';
import { useItemMacro } from './module/macro.js';
import { cypherRuler } from './module/ruler.js';
Hooks.once("init", function() {
console.log('Numenera | Initializing Numenera System');
game.numenera = {
applications: {
RecoveryDialog,
},
useItemMacro,
};
// Record Configuration Values
CONFIG.NUMENERA = NUMENERA;
//Dirty trick to instantiate the right class. Kids, do NOT try this at home.
CONFIG.Actor.entityClass = NumeneraActor;
CONFIG.Item.entityClass = NumeneraItem;
//Each type of Actor will provide its own personal, free-range, bio, nut-free formula.
Combat.prototype._getInitiativeFormula = getInitiativeFormula;
Combat.prototype.rollInitiative = rollInitiative;
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("numenera", NumeneraCommunityActorSheet, { types: ["community"], makeDefault: true });
Actors.registerSheet("numenera", NumeneraNPCActorSheet, { types: ["npc"], makeDefault: true });
Actors.registerSheet("numenera", NumeneraPCActorSheet, { types: ["pc"], makeDefault: true });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("numenera", NumeneraAbilityItemSheet, { types: ["ability"], makeDefault: true });
Items.registerSheet("numenera", NumeneraArmorItemSheet, { types: ["armor"], makeDefault: true });
Items.registerSheet("numenera", NumeneraArtifactItemSheet, { types: ["artifact"], makeDefault: true });
Items.registerSheet("numenera", NumeneraCypherItemSheet, { types: ["cypher"], makeDefault: true });
Items.registerSheet("numenera", NumeneraEquipmentItemSheet, { types: ["equipment"], makeDefault: true });
Items.registerSheet("numenera", NumeneraOddityItemSheet, { types: ["oddity"], makeDefault: true });
Items.registerSheet("numenera", NumeneraSkillItemSheet, { types: ["skill"], makeDefault: true });
Items.registerSheet("numenera", NumeneraWeaponItemSheet, { types: ["weapon"], makeDefault: true });
Items.registerSheet("numenera", StrangeRecursionItemSheet, { types: ["recursion"], makeDefault: true });
//May seem weird but otherwise
Items.registerSheet("numenera", ActorSheet, { types: ["npcAttack"], makeDefault: true });
registerSystemSettings();
registerHandlebarHelpers();
preloadHandlebarsTemplates();
});
//Place asy clean, well-behaved hook here
Hooks.once("init", cypherToken);
Hooks.once("init", cypherRuler);
Hooks.once("ready", add3rdBarToPCTokens);
Hooks.once("ready", migrateWorld);
Hooks.once("ready", numeneraSocketListeners);
//Random hooks should go in there
Hooks.once("ready", registerHooks);