story-teller 1.1.3
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.
- checksums.yaml +7 -0
- data/LICENSE +623 -0
- data/README.md +188 -0
- data/Rakefile +58 -0
- data/config/database.yml +37 -0
- data/exe/inform.rb +6 -0
- data/game/config.yml +5 -0
- data/game/example.inf +90 -0
- data/game/example.rb +105 -0
- data/game/forms/example_form.rb +2 -0
- data/game/grammar/admin.inf.rb +185 -0
- data/game/grammar/builder.inf.rb +310 -0
- data/game/grammar/game_grammar.inf.rb +6 -0
- data/game/grammar/meta.inf.rb +41 -0
- data/game/languages/english.rb +571 -0
- data/game/models/example_model.rb +2 -0
- data/game/modules/example_module.rb +9 -0
- data/game/modules/parser_extensions.rb +264 -0
- data/game/rules/example_state.rb +2 -0
- data/game/scripts/example_script.rb +2 -0
- data/game/topics/example_topic.rb +2 -0
- data/game/verbs/game_verbs.rb +35 -0
- data/game/verbs/metaverbs.rb +2066 -0
- data/lib/story_teller/application.rb +82 -0
- data/lib/story_teller/cli.rb +35 -0
- data/lib/story_teller/color.rb +144 -0
- data/lib/story_teller/config.rb +61 -0
- data/lib/story_teller/curses_adapter.rb +30 -0
- data/lib/story_teller/database.rb +527 -0
- data/lib/story_teller/game/loader.rb +276 -0
- data/lib/story_teller/game.rb +22 -0
- data/lib/story_teller/inform/models.rb +42 -0
- data/lib/story_teller/inform/relational/link.rb +239 -0
- data/lib/story_teller/inform/relational/module.rb +203 -0
- data/lib/story_teller/inform/relational/object.rb +546 -0
- data/lib/story_teller/inform/relational/tag.rb +152 -0
- data/lib/story_teller/options.rb +151 -0
- data/lib/story_teller/persistence.rb +340 -0
- data/lib/story_teller/player_character.rb +99 -0
- data/lib/story_teller/privileges.rb +55 -0
- data/lib/story_teller/runtime.rb +381 -0
- data/lib/story_teller/snapshots.rb +412 -0
- data/lib/story_teller/terminal.rb +58 -0
- data/lib/story_teller/version.rb +24 -0
- data/lib/story_teller_cli.rb +34 -0
- metadata +158 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# game/grammar/builder.inf.rb
|
|
2
|
+
# encoding: utf-8
|
|
3
|
+
# frozen_string_literal: false
|
|
4
|
+
|
|
5
|
+
# vi: set ft=ruby :
|
|
6
|
+
# -*- mode: ruby -*-
|
|
7
|
+
|
|
8
|
+
# Copyright Nels Nelson 2008-2025 but freely usable (see license)
|
|
9
|
+
#
|
|
10
|
+
# This file is part of the StoryTeller.
|
|
11
|
+
#
|
|
12
|
+
# The StoryTeller is free software: you can redistribute it and/or
|
|
13
|
+
# modify it under the terms of the GNU General Public License as published
|
|
14
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
|
15
|
+
# (at your option) any later version.
|
|
16
|
+
#
|
|
17
|
+
# The StoryTeller is distributed in the hope that it will be useful,
|
|
18
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
+
# GNU General Public License for more details.
|
|
21
|
+
#
|
|
22
|
+
# You should have received a copy of the GNU General Public License
|
|
23
|
+
# along with the StoryTeller. If not, see <http://www.gnu.org/licenses/>.
|
|
24
|
+
|
|
25
|
+
Verb meta 'ancestors'
|
|
26
|
+
* -> Ancestors
|
|
27
|
+
* 'as' special -> Ancestors
|
|
28
|
+
* 'of' noun -> Ancestors
|
|
29
|
+
* id -> Ancestors
|
|
30
|
+
* noun -> Ancestors
|
|
31
|
+
* 'of' noun 'as' special -> Ancestors
|
|
32
|
+
* id 'as' special -> Ancestors
|
|
33
|
+
* noun 'as' special -> Ancestors;
|
|
34
|
+
Verb meta 'branch'
|
|
35
|
+
* -> Branch
|
|
36
|
+
* 'as' special -> Branch
|
|
37
|
+
* 'of' noun -> Branch
|
|
38
|
+
* id -> Branch
|
|
39
|
+
* noun -> Branch
|
|
40
|
+
* 'of' noun 'as' special -> Branch
|
|
41
|
+
* id 'as' special -> Branch
|
|
42
|
+
* noun 'as' special -> Branch;
|
|
43
|
+
Verb meta 'descendants'
|
|
44
|
+
* -> Descendants
|
|
45
|
+
* 'as' special -> Descendants
|
|
46
|
+
* 'of' noun -> Descendants
|
|
47
|
+
* id -> Descendants
|
|
48
|
+
* noun -> Descendants
|
|
49
|
+
* 'all' noun -> AllDescendants
|
|
50
|
+
* 'of' noun 'as' special -> Descendants
|
|
51
|
+
* id 'as' special -> Descendants
|
|
52
|
+
* noun 'as' special -> Descendants;
|
|
53
|
+
Verb meta 'siblings'
|
|
54
|
+
* -> Siblings
|
|
55
|
+
* 'as' special -> Siblings
|
|
56
|
+
* 'of' noun -> Siblings
|
|
57
|
+
* id -> Siblings
|
|
58
|
+
* noun -> Siblings
|
|
59
|
+
* 'of' noun 'as' special -> Siblings
|
|
60
|
+
* id 'as' special -> Siblings
|
|
61
|
+
* noun 'as' special -> Siblings;
|
|
62
|
+
Verb meta 'region'
|
|
63
|
+
* -> Region
|
|
64
|
+
* id -> Region
|
|
65
|
+
* noun -> Region
|
|
66
|
+
* scope=RegionsScope -> Region;
|
|
67
|
+
Verb meta 'regions'
|
|
68
|
+
* -> Regions;
|
|
69
|
+
Verb meta 'rooms'
|
|
70
|
+
* -> Rooms
|
|
71
|
+
* 'as' special -> Rooms;
|
|
72
|
+
Verb meta 'root'
|
|
73
|
+
* -> Root
|
|
74
|
+
* noun -> Root;
|
|
75
|
+
Verb meta 'area'
|
|
76
|
+
* -> Area
|
|
77
|
+
* id -> Area
|
|
78
|
+
* noun -> Area
|
|
79
|
+
* scope=AreasScope -> Area;
|
|
80
|
+
Verb meta 'areas'
|
|
81
|
+
* -> Areas;
|
|
82
|
+
Verb meta 'attributes'
|
|
83
|
+
* -> Attributes
|
|
84
|
+
* special -> Attributes;
|
|
85
|
+
Verb meta 'builder' 'builders'
|
|
86
|
+
* -> Builders;
|
|
87
|
+
Verb meta 'classify'
|
|
88
|
+
* noun -> Classify
|
|
89
|
+
* id 'as' special -> Classify
|
|
90
|
+
* multi 'as' special -> Classify;
|
|
91
|
+
Verb meta 'commands'
|
|
92
|
+
* special -> CommandsByMode;
|
|
93
|
+
Verb meta 'taxonomy'
|
|
94
|
+
* noun -> Taxonomy;
|
|
95
|
+
Verb meta 'copy' 'clone' 'graft'
|
|
96
|
+
* id -> Copy
|
|
97
|
+
* noun -> Copy;
|
|
98
|
+
Verb meta 'build'
|
|
99
|
+
* 'door' noun=ADirection -> CreateDoor
|
|
100
|
+
* 'door' noun=ADirection 'called' text -> CreateDoor
|
|
101
|
+
* 'door' noun=ADirection text -> CreateDoor
|
|
102
|
+
* 'room'/'exit' noun=ADirection -> CreateRoom
|
|
103
|
+
* 'room'/'exit' noun=ADirection 'called' text -> CreateRoom
|
|
104
|
+
* 'room'/'exit' noun=ADirection text -> CreateRoom;
|
|
105
|
+
Extend meta 'create'
|
|
106
|
+
* 'door' noun=ADirection -> CreateDoor
|
|
107
|
+
* 'door' noun=ADirection 'called' text -> CreateDoor
|
|
108
|
+
* 'door' noun=ADirection text -> CreateDoor
|
|
109
|
+
* 'room' -> CreateRoom
|
|
110
|
+
* 'room'/'exit' noun=ADirection -> CreateRoom
|
|
111
|
+
* 'room'/'exit' noun=ADirection 'called' text -> CreateRoom
|
|
112
|
+
* 'room'/'exit' noun=ADirection text -> CreateRoom
|
|
113
|
+
* 'room' 'from' noun=ADirection 'to' noun=ADirection 'called' text -> CreateRoom
|
|
114
|
+
* 'room' 'from' noun=ADirection 'to' noun=ADirection text -> CreateRoom
|
|
115
|
+
* 'room'/'exit' text -> CreateRoom
|
|
116
|
+
* 'a' 'pair' 'of' text -> CreatePair
|
|
117
|
+
* 'pair' 'of' text -> CreatePair
|
|
118
|
+
* text -> Create;
|
|
119
|
+
Verb meta 'delete' 'dismiss' 'orphan'
|
|
120
|
+
* id -> Delete
|
|
121
|
+
* noun -> Delete
|
|
122
|
+
* 'user' text -> DeleteUser;
|
|
123
|
+
Extend meta only 'describe' replace
|
|
124
|
+
* noun 'as' 'nothing' -> ClearDescription
|
|
125
|
+
* noun 'nothing' -> ClearDescription
|
|
126
|
+
* noun 'as' text -> Describe
|
|
127
|
+
* noun text -> Describe
|
|
128
|
+
* noun -> Examine
|
|
129
|
+
* 'room' -> DescribeRoom
|
|
130
|
+
* 'room' 'as' 'nothing' -> ClearRoomDescription
|
|
131
|
+
* 'room' 'as' text -> DescribeRoom;
|
|
132
|
+
Extend meta only 'prune' replace
|
|
133
|
+
* 'all' -> PurgeAllOrphans
|
|
134
|
+
* id -> Purge
|
|
135
|
+
* id 'force' -> PurgeDangerously
|
|
136
|
+
* noun -> Purge
|
|
137
|
+
* noun 'force' -> PurgeDangerously;
|
|
138
|
+
Verb meta 'purge' = 'prune';
|
|
139
|
+
Verb meta 'edit' 'modify' 'change' 'update'
|
|
140
|
+
* noun -> Edit;
|
|
141
|
+
Verb meta 'find'
|
|
142
|
+
* special 'is' text -> FindByProperty
|
|
143
|
+
* 'described' 'as' text -> FindByDescription
|
|
144
|
+
* 'has' special -> FindByAttribute
|
|
145
|
+
* 'class' special -> FindByClass
|
|
146
|
+
* 'link' special -> FindByLink
|
|
147
|
+
* 'link' special 'is' noun -> FindByLink
|
|
148
|
+
* 'link' special 'is' id -> FindByLink
|
|
149
|
+
* 'link' special 'is' query -> FindByLink
|
|
150
|
+
* 'mod' special -> FindByModule
|
|
151
|
+
* query -> Find;
|
|
152
|
+
Verb meta 'fetch'
|
|
153
|
+
* id -> Fetch
|
|
154
|
+
* query -> Fetch;
|
|
155
|
+
Extend meta 'force'
|
|
156
|
+
* noun 'to' text -> Force;
|
|
157
|
+
Verb meta 'inspect'
|
|
158
|
+
* 'room'/'location' -> InspectLocation
|
|
159
|
+
* 'parent' -> InspectParent
|
|
160
|
+
* 'module' special -> InspectModule
|
|
161
|
+
* id -> Inspect
|
|
162
|
+
* noun -> Inspect
|
|
163
|
+
* query -> Inspect;
|
|
164
|
+
Verb meta 'is' 'are'
|
|
165
|
+
* noun 'in' noun -> IsIn
|
|
166
|
+
* noun 'notin' noun -> IsNotIn;
|
|
167
|
+
Verb meta 'generate'
|
|
168
|
+
* number text 'on' noun 'every' special -> Generate;
|
|
169
|
+
Verb meta 'regenerate'
|
|
170
|
+
* noun 'with' number text 'every' special -> Regenerate
|
|
171
|
+
* noun -> Regenerate;
|
|
172
|
+
Extend meta 'gonear' replace
|
|
173
|
+
* scope=PlayerScope -> Gonear;
|
|
174
|
+
Extend meta 'goto' replace
|
|
175
|
+
* noun -> Goto
|
|
176
|
+
* id -> Goto
|
|
177
|
+
* query -> Goto;
|
|
178
|
+
Verb meta 'return'
|
|
179
|
+
* -> Return;
|
|
180
|
+
Extend meta 'let'
|
|
181
|
+
* id special 'be' 'nothing' -> Unassign
|
|
182
|
+
* multi special 'be' 'nothing' -> Unassign
|
|
183
|
+
* id special 'be' text -> Assign
|
|
184
|
+
* multi special 'be' text -> Assign
|
|
185
|
+
* special 'of' multi 'be' 'nothing' -> Unassign reverse
|
|
186
|
+
* special 'of' multi 'be' text -> Assign reverse
|
|
187
|
+
* 'room' special 'be' 'nothing' -> UnassignRoom
|
|
188
|
+
* 'room' special 'be' text -> AssignRoom;
|
|
189
|
+
Extend meta 'list'
|
|
190
|
+
* id 'and' id 'together' -> ListTogether
|
|
191
|
+
* noun 'and' noun 'together' -> ListTogether
|
|
192
|
+
* 'together' id 'and' id -> ListTogether
|
|
193
|
+
* 'together' noun 'and' noun -> ListTogether;
|
|
194
|
+
Verb meta 'link'
|
|
195
|
+
* noun=ADirection 'to' id -> Link
|
|
196
|
+
* noun=ADirection 'to' noun -> Link
|
|
197
|
+
* noun 'to' id 'through' special -> Link
|
|
198
|
+
* noun 'to' noun 'through' special -> Link
|
|
199
|
+
* special id -> Link
|
|
200
|
+
* special noun -> Link;
|
|
201
|
+
Verb meta 'unlink'
|
|
202
|
+
* noun=ADirection -> Unlink
|
|
203
|
+
* id special -> Unlink
|
|
204
|
+
* noun special -> Unlink
|
|
205
|
+
* special -> Unlink;
|
|
206
|
+
Verb meta 'location'
|
|
207
|
+
* -> Location
|
|
208
|
+
* 'as' special -> Location;
|
|
209
|
+
Verb meta 'mod' 'imbue'
|
|
210
|
+
* noun -> ApplyBehavior
|
|
211
|
+
* id 'as'/'with' special -> ApplyBehavior
|
|
212
|
+
* multi 'as'/'with' special -> ApplyBehavior;
|
|
213
|
+
Verb meta 'unmod'
|
|
214
|
+
* id 'as' special -> RemoveBehavior
|
|
215
|
+
* id special -> RemoveBehavior
|
|
216
|
+
* multi 'as' special -> RemoveBehavior
|
|
217
|
+
* multi special -> RemoveBehavior;
|
|
218
|
+
Verb meta 'modules'
|
|
219
|
+
* -> Modules
|
|
220
|
+
* noun -> Modules;
|
|
221
|
+
Verb meta 'mute'
|
|
222
|
+
* -> Mute
|
|
223
|
+
* noun -> Mute;
|
|
224
|
+
Verb meta 'unmute'
|
|
225
|
+
* noun -> Unmute;
|
|
226
|
+
Verb meta 'name'
|
|
227
|
+
* -> Name
|
|
228
|
+
* 'room' text -> NameRoom
|
|
229
|
+
* id -> Name
|
|
230
|
+
* id text -> Name
|
|
231
|
+
* noun -> Name
|
|
232
|
+
* noun text -> Name;
|
|
233
|
+
Verb meta 'rename'
|
|
234
|
+
* 'room' 'to'/'as' text -> NameRoom
|
|
235
|
+
* 'room' text -> NameRoom
|
|
236
|
+
* id 'to'/'as' text -> Name
|
|
237
|
+
* noun 'to'/'as' text -> Name;
|
|
238
|
+
Verb meta 'new'
|
|
239
|
+
* topic -> New;
|
|
240
|
+
Verb meta 'on'
|
|
241
|
+
* special noun 'should' text -> On reverse;
|
|
242
|
+
Verb meta 'before'
|
|
243
|
+
* special noun text -> CreateBefore;
|
|
244
|
+
Verb meta 'when'
|
|
245
|
+
* 'you'/'i' special noun text -> CreateBefore
|
|
246
|
+
* 'you'/'i' special text -> CreateBeforeRoom
|
|
247
|
+
* noun 'notices' special 'it' 'should' text -> On;
|
|
248
|
+
Verb meta 'refer'
|
|
249
|
+
* 'to' id 'as'/'with' text -> Reference
|
|
250
|
+
* 'to' noun 'as'/'with' text -> Reference
|
|
251
|
+
* id text -> Reference
|
|
252
|
+
* noun text -> Reference;
|
|
253
|
+
Verb meta 'reference'
|
|
254
|
+
* id 'with'/'by' text -> Reference
|
|
255
|
+
* noun 'with'/'by' text -> Reference
|
|
256
|
+
* id text -> Reference
|
|
257
|
+
* noun text -> Reference;
|
|
258
|
+
Verb meta 'call'
|
|
259
|
+
* noun 'by' text -> Reference
|
|
260
|
+
* noun text -> Reference;
|
|
261
|
+
Verb meta 'refresh'
|
|
262
|
+
* id -> Refresh
|
|
263
|
+
* noun -> Refresh
|
|
264
|
+
* query -> Refresh;
|
|
265
|
+
Extend meta 'save'
|
|
266
|
+
* noun -> Save;
|
|
267
|
+
Verb meta 'schedule'
|
|
268
|
+
* noun topic 'at' time -> Schedule
|
|
269
|
+
* noun topic 'at' time 'every' interval -> Schedule;
|
|
270
|
+
Extend meta only 'daemons' replace
|
|
271
|
+
* -> Daemons
|
|
272
|
+
* 'on' -> DaemonsOn
|
|
273
|
+
* 'off' -> DaemonsOff;
|
|
274
|
+
Extend meta 'score'
|
|
275
|
+
* scope=PlayerCharacterScope -> ScoreOther;
|
|
276
|
+
Extend meta 'fullscore'
|
|
277
|
+
* scope=PlayerCharacterScope -> FullScoreOther;
|
|
278
|
+
Extend meta 'full'
|
|
279
|
+
* 'score' scope=PlayerCharacterScope -> FullScoreOther;
|
|
280
|
+
Verb meta 'tag' 'label'
|
|
281
|
+
* noun -> Tag
|
|
282
|
+
* multi 'with'/'as' 'not' text -> Untag
|
|
283
|
+
* multi 'with'/'as' text -> Tag
|
|
284
|
+
* noun text -> Tag
|
|
285
|
+
* 'room' text -> TagRoom;
|
|
286
|
+
Verb meta 'untag' 'unlabel'
|
|
287
|
+
* noun -> Untag
|
|
288
|
+
* id 'with' text -> Untag
|
|
289
|
+
* multi text -> Untag
|
|
290
|
+
* 'room' text -> UntagRoom;
|
|
291
|
+
Verb meta 'make'
|
|
292
|
+
* noun -> Tag
|
|
293
|
+
* id 'not' text -> Untag
|
|
294
|
+
* noun 'not' text -> Untag
|
|
295
|
+
* multi 'into' 'not' text -> Untag
|
|
296
|
+
* multi 'into' text -> Tag
|
|
297
|
+
* id text -> Tag
|
|
298
|
+
* multi text -> Tag
|
|
299
|
+
* 'room' 'not' text -> UntagRoom
|
|
300
|
+
* 'room' text -> TagRoom;
|
|
301
|
+
Verb meta 'weather'
|
|
302
|
+
* -> Weather
|
|
303
|
+
* noun -> Weather;
|
|
304
|
+
Extend meta 'abstract'
|
|
305
|
+
* noun 'to' id -> XAbstract
|
|
306
|
+
* id 'to' id -> XAbstract;
|
|
307
|
+
Extend meta 'purloin'
|
|
308
|
+
* id -> XPurloin;
|
|
309
|
+
Extend meta 'tree'
|
|
310
|
+
* id -> XTree;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# game/grammar/meta.inf.rb
|
|
2
|
+
# encoding: utf-8
|
|
3
|
+
# frozen_string_literal: false
|
|
4
|
+
|
|
5
|
+
# vi: set ft=ruby :
|
|
6
|
+
# -*- mode: ruby -*-
|
|
7
|
+
|
|
8
|
+
# Copyright Nels Nelson 2008-2025 but freely usable (see license)
|
|
9
|
+
#
|
|
10
|
+
# This file is part of the StoryTeller.
|
|
11
|
+
#
|
|
12
|
+
# The StoryTeller is free software: you can redistribute it and/or
|
|
13
|
+
# modify it under the terms of the GNU General Public License as published
|
|
14
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
|
15
|
+
# (at your option) any later version.
|
|
16
|
+
#
|
|
17
|
+
# The StoryTeller is distributed in the hope that it will be useful,
|
|
18
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20
|
+
# GNU General Public License for more details.
|
|
21
|
+
#
|
|
22
|
+
# You should have received a copy of the GNU General Public License
|
|
23
|
+
# along with the StoryTeller. If not, see <http://www.gnu.org/licenses/>.
|
|
24
|
+
|
|
25
|
+
Extend meta 'commands' first
|
|
26
|
+
* -> Commands;
|
|
27
|
+
Verb meta 'help'
|
|
28
|
+
* -> Help
|
|
29
|
+
* topic -> Help;
|
|
30
|
+
Verb meta 'history' 'hist' '!'
|
|
31
|
+
* -> History
|
|
32
|
+
* number -> History
|
|
33
|
+
* 'clear' -> ClearHistory;
|
|
34
|
+
Verb meta 'options'
|
|
35
|
+
* -> Options
|
|
36
|
+
* 'set' special text -> Options;
|
|
37
|
+
Verb meta 'wrap'
|
|
38
|
+
* -> Wrap
|
|
39
|
+
* number -> Wrap;
|
|
40
|
+
Verb meta 'visited'
|
|
41
|
+
* -> Visited;
|