@ai-rpg-engine/starter-template 3.9.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/content.json +8 -0
- package/src/content.ts +3 -0
- package/src/setup.ts +8 -0
- package/src/starter.test.ts +10 -0
package/package.json
CHANGED
package/src/content.json
CHANGED
package/src/content.ts
CHANGED
|
@@ -190,6 +190,9 @@ export const pack: ContentPack = {
|
|
|
190
190
|
zones,
|
|
191
191
|
placements,
|
|
192
192
|
districts,
|
|
193
|
+
factions: {
|
|
194
|
+
'my-game': { id: 'my-game', name: 'My Game', reputation: 0, disposition: 'neutral' },
|
|
195
|
+
},
|
|
193
196
|
buildCatalog: buildCatalog as ContentPack['buildCatalog'],
|
|
194
197
|
progressionTrees: [progressionTree],
|
|
195
198
|
statuses: statusDefinitions,
|
package/src/setup.ts
CHANGED
|
@@ -128,6 +128,14 @@ export function createGame(seed?: number): Engine {
|
|
|
128
128
|
// ...
|
|
129
129
|
// const worldStack = buildWorldStack({
|
|
130
130
|
// playerId: 'player',
|
|
131
|
+
// factions: [{
|
|
132
|
+
// factionId: 'my-game',
|
|
133
|
+
// entityIds: ['grunt'],
|
|
134
|
+
// cohesion: 0.8,
|
|
135
|
+
// name: 'My Game',
|
|
136
|
+
// reputation: 0,
|
|
137
|
+
// disposition: 'neutral',
|
|
138
|
+
// }],
|
|
131
139
|
// tradeGenre: myRuleset.id, // or a literal genre string
|
|
132
140
|
// craftingGenre: myRuleset.id,
|
|
133
141
|
// economyGenre: myRuleset.id,
|
package/src/starter.test.ts
CHANGED
|
@@ -41,6 +41,16 @@ describe('starter template', () => {
|
|
|
41
41
|
expect(engine).toBeDefined();
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
it('F-749aba8e: pack.factions seeds WorldState.factions for controllingFaction my-game', () => {
|
|
45
|
+
const engine = createGame(1);
|
|
46
|
+
expect(engine.store.state.factions['my-game']).toEqual({
|
|
47
|
+
id: 'my-game',
|
|
48
|
+
name: 'My Game',
|
|
49
|
+
reputation: 0,
|
|
50
|
+
disposition: 'neutral',
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
44
54
|
it('tension rises when combat damage lands (tension-pressure fires)', () => {
|
|
45
55
|
const engine = createGame(1);
|
|
46
56
|
expect(engine.world.entities['player']?.resources.tension).toBe(0);
|