@adatechnology/game-stories 0.2.8 → 0.3.1
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/README.md +5 -4
- package/dist/chunk-27E2JRXQ.js +1563 -0
- package/dist/chunk-27E2JRXQ.js.map +1 -0
- package/dist/index.d.ts +4 -1033
- package/dist/index.global.js +62 -7
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +26 -1525
- package/dist/index.js.map +1 -1
- package/dist/testing-ezx8QVeB.d.ts +1124 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +11 -0
- package/dist/testing.js.map +1 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ It is a literal port of two team deliveries:
|
|
|
10
10
|
- **Os Vivos do Vale** (`site/pages/sobreviventes/os-vivos-do-vale.html`): `life()`, `simulate()` and the event engine (`EV`, `ACTS`, `fill`), made
|
|
11
11
|
generic. The valley's people and its 47 events are not here: they are the zombiada slice (`specs/001-migracao-entregas-dos-times/game-slice/stories/`).
|
|
12
12
|
- **Personagens** (`site/pages/zumbis-personagens/personagens.html`): the sheet (point buy, derived values, skills and milestones, memory and opinion).
|
|
13
|
-
The ruleset itself (attributes, skills, professions, traits, formulas) and the name pools are content in `@adatechnology/game-characters-people
|
|
13
|
+
The ruleset itself (attributes, skills, professions, traits, formulas) and the name pools are content in `@adatechnology/game-characters-people`; the game passes `names` and `ruleset` (the recommended path; `defaultStoryContent()` of `@adatechnology/game-kit-defaults` has the pack's). Without them the core falls back to that pack, a deprecated default removed in the next major.
|
|
14
14
|
|
|
15
15
|
The golden `game-stories-life.json` (7 full lives line by line, 40 more by hash, 96 sets of player actions without the life simulation and 48 sheets,
|
|
16
16
|
all recorded by running the team code in `node:vm` with `tools/characters-catalog`) is replayed by the tests.
|
|
@@ -40,8 +40,9 @@ Browser without a bundler (the global is `GameStories`):
|
|
|
40
40
|
|
|
41
41
|
```ts
|
|
42
42
|
import { createStoryWorld, createSheet } from '@adatechnology/game-stories'
|
|
43
|
+
import { getNamePools, SHEET_RULESET } from '@adatechnology/game-characters-people' // or defaultStoryContent() of @adatechnology/game-kit-defaults
|
|
43
44
|
|
|
44
|
-
const world = createStoryWorld({ people, stories, life: { groups, relations, couples }, fill: 80, seed: 7, locale: 'pt-BR' })
|
|
45
|
+
const world = createStoryWorld({ names: getNamePools('pt-BR'), ruleset: SHEET_RULESET, people, stories, life: { groups, relations, couples }, fill: 80, seed: 7, locale: 'pt-BR' })
|
|
45
46
|
world.act('fix_well') // a player action: the stories read it from today on
|
|
46
47
|
world.runTo(30)
|
|
47
48
|
world.chronicle.entries // every line, by day
|
|
@@ -50,7 +51,7 @@ const sheet = world.sheet(world.cast('keeper')) // the same world, the same shee
|
|
|
50
51
|
sheet.history // the stories and events the person lived
|
|
51
52
|
sheet.derived() // max health, stamina, load, running speed... from the ruleset
|
|
52
53
|
|
|
53
|
-
const mine = createSheet({ profession: 'nurse', attributes: { agility: 6 }, traits: ['athlete'] })
|
|
54
|
+
const mine = createSheet({ ruleset: SHEET_RULESET, profession: 'nurse', attributes: { agility: 6 }, traits: ['athlete'] })
|
|
54
55
|
mine.pool() // points left of the 14
|
|
55
56
|
```
|
|
56
57
|
|
|
@@ -75,7 +76,7 @@ A story:
|
|
|
75
76
|
|
|
76
77
|
## Test area
|
|
77
78
|
|
|
78
|
-
`createStoriesTestModule()` (`stories_area`, only the generic contracts) puts the seed, the day, the life simulation, the infection layer, the player
|
|
79
|
+
`createStoriesTestModule({ names?, ruleset?, professionName? })` (`stories_area`, only the generic contracts) puts the seed, the day, the life simulation, the infection layer, the player
|
|
79
80
|
actions and a person's sheet on the bench, with six scenarios (determinism, casting, the normal world, the sheet keeps what was lived, the point buy and
|
|
80
81
|
two stories crossing). It runs the kit's example content (two small stories on a farm and a town, marked `example`) until a game loads its own
|
|
81
82
|
(`module.load(content)`). `examples/stories-test-area` loads it into the shared test room (`sala-historias.html`, with a button for a JSON file such as the
|