scottkit 1.4.0 → 1.5.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.
- checksums.yaml +4 -4
- data/ChangeLog.md +11 -3
- data/README.md +11 -9
- data/VERSION +1 -1
- data/bin/scottkit +7 -1
- data/data/adams/.gitignore +1 -0
- data/data/nosferatu/Makefile +2 -2
- data/data/nosferatu/TODO +51 -0
- data/data/nosferatu/nosferatu.regression +224 -113
- data/data/nosferatu/nosferatu.sck +201 -36
- data/data/nosferatu/{nosferatu.script → nosferatu.transcript} +91 -9
- data/data/test/t6.pretty-print +16 -2
- data/data/tutorial/t4.sck +12 -3
- data/data/tutorial/t5.map +1 -1
- data/data/tutorial/t5.sck +43 -7
- data/data/tutorial/t6.sck +38 -7
- data/data/tutorial/t7.sck +20 -10
- data/data/tutorial/tutorial.md +24 -9
- data/lib/scottkit/compile.rb +29 -4
- data/lib/scottkit/game.rb +2 -2
- data/lib/scottkit/play.rb +3 -3
- data/manual/reference.md +3 -3
- metadata +4 -3
data/data/tutorial/t7.sck
CHANGED
@@ -55,15 +55,19 @@ room throne "gorgeously decorated throne room"
|
|
55
55
|
|
56
56
|
item sign "Sign says: leave treasure here, then say SCORE"
|
57
57
|
|
58
|
-
item lamp "old-fashioned brass lamp"
|
59
|
-
|
58
|
+
item lamp "old-fashioned brass lamp"
|
59
|
+
called "lamp"
|
60
|
+
|
61
|
+
item empty_lamp "empty lamp"
|
62
|
+
called "lamp" nowhere
|
63
|
+
|
60
64
|
lightsource lamp
|
61
65
|
|
62
66
|
occur 100% when flag 16
|
63
67
|
clear_flag 16
|
64
68
|
swap lamp empty_lamp
|
65
69
|
look
|
66
|
-
comment "The engine
|
70
|
+
comment "The engine sets flag 16 when the lamp runs out"
|
67
71
|
|
68
72
|
room chamber "square chamber"
|
69
73
|
exit east dungeon
|
@@ -71,7 +75,7 @@ room chamber "square chamber"
|
|
71
75
|
exit west cave
|
72
76
|
|
73
77
|
# Flag 15 is on when and only when it is dark
|
74
|
-
occur when
|
78
|
+
occur when at chamber and flag 15
|
75
79
|
clear_dark
|
76
80
|
look
|
77
81
|
|
@@ -82,11 +86,11 @@ room dungeon "gloomy dungeon"
|
|
82
86
|
exit west chamber
|
83
87
|
exit north crypt
|
84
88
|
|
85
|
-
occur when
|
89
|
+
occur when at dungeon and !flag 15
|
86
90
|
set_dark
|
87
91
|
look
|
88
92
|
|
89
|
-
occur 25% when
|
93
|
+
occur 25% when at dungeon
|
90
94
|
print "I smell something rotting to the north."
|
91
95
|
|
92
96
|
item door "Locked door"
|
@@ -98,7 +102,7 @@ item key "Brass key"
|
|
98
102
|
item door2 "Open door leads south"
|
99
103
|
nowhere
|
100
104
|
|
101
|
-
action open door when here door and !
|
105
|
+
action open door when here door and !present key
|
102
106
|
print "It's locked."
|
103
107
|
|
104
108
|
action open door when here door
|
@@ -121,13 +125,19 @@ room crypt "damp, dismal crypt"
|
|
121
125
|
|
122
126
|
item vampire "Vampire"
|
123
127
|
|
128
|
+
occur when here vampire and carried cross
|
129
|
+
print "Vampire cowers away from the cross!"
|
130
|
+
|
124
131
|
occur when here vampire and !carried cross
|
132
|
+
print "Vampire looks hungrily at me."
|
133
|
+
|
134
|
+
occur 25% when here vampire and !carried cross
|
125
135
|
print "Vampire bites me! I'm dead!"
|
126
136
|
game_over
|
127
|
-
comment "vampire
|
137
|
+
comment "vampire can attack unless cross is carried"
|
128
138
|
|
129
|
-
|
130
|
-
print "
|
139
|
+
action get key when here vampire and !carried cross
|
140
|
+
print "I'm not going anywhere near that vampire!"
|
131
141
|
|
132
142
|
verbgroup take get
|
133
143
|
verbgroup leave drop
|
data/data/tutorial/tutorial.md
CHANGED
@@ -203,6 +203,9 @@ room dungeon "gloomy dungeon"
|
|
203
203
|
exit west chamber
|
204
204
|
exit north crypt
|
205
205
|
|
206
|
+
occur 25% when at dungeon
|
207
|
+
print "I smell something rotting to the north."
|
208
|
+
|
206
209
|
item door "Locked door"
|
207
210
|
|
208
211
|
item key "Brass key"
|
@@ -235,13 +238,19 @@ room crypt "damp, dismal crypt"
|
|
235
238
|
|
236
239
|
item vampire "Vampire"
|
237
240
|
|
241
|
+
occur when here vampire and carried cross
|
242
|
+
print "Vampire cowers away from the cross!"
|
243
|
+
|
238
244
|
occur when here vampire and !carried cross
|
245
|
+
print "Vampire looks hungrily at me."
|
246
|
+
|
247
|
+
occur 25% when here vampire and !carried cross
|
239
248
|
print "Vampire bites me! I'm dead!"
|
240
249
|
game_over
|
241
|
-
comment "vampire
|
250
|
+
comment "vampire can attack unless cross is carried"
|
242
251
|
|
243
|
-
|
244
|
-
print "
|
252
|
+
action get key when present vampire and !carried cross
|
253
|
+
print "I'm not going anywhere near that vampire!"
|
245
254
|
```
|
246
255
|
|
247
256
|
|
@@ -297,7 +306,7 @@ room chamber "square chamber"
|
|
297
306
|
exit west cave
|
298
307
|
|
299
308
|
# Flag 15 is on when and only when it is dark
|
300
|
-
occur when
|
309
|
+
occur when at chamber and flag 15
|
301
310
|
clear_dark
|
302
311
|
look
|
303
312
|
|
@@ -308,11 +317,11 @@ room dungeon "gloomy dungeon"
|
|
308
317
|
exit west chamber
|
309
318
|
exit north crypt
|
310
319
|
|
311
|
-
occur when
|
320
|
+
occur when at dungeon and !flag 15
|
312
321
|
set_dark
|
313
322
|
look
|
314
323
|
|
315
|
-
occur 25% when
|
324
|
+
occur 25% when at dungeon
|
316
325
|
print "I smell something rotting to the north."
|
317
326
|
|
318
327
|
item door "Locked door"
|
@@ -347,14 +356,20 @@ room crypt "damp, dismal crypt"
|
|
347
356
|
|
348
357
|
item vampire "Vampire"
|
349
358
|
|
350
|
-
occur when here vampire and !carried cross
|
359
|
+
occur 25% when here vampire and !carried cross
|
351
360
|
print "Vampire bites me! I'm dead!"
|
352
361
|
game_over
|
353
|
-
comment "vampire
|
362
|
+
comment "vampire can attack unless cross is carried"
|
354
363
|
|
355
|
-
occur when here vampire and
|
364
|
+
occur when here vampire and !carried cross
|
365
|
+
print "Vampire looks hungrily at me."
|
366
|
+
|
367
|
+
occur when here vampire and carried cross
|
356
368
|
print "Vampire cowers away from the cross!"
|
357
369
|
|
370
|
+
action get key when present vampire and !carried cross
|
371
|
+
print "I'm not going anywhere near that vampire!"
|
372
|
+
|
358
373
|
verbgroup take get
|
359
374
|
verbgroup leave drop
|
360
375
|
noungroup lamp lantern
|
data/lib/scottkit/compile.rb
CHANGED
@@ -132,8 +132,8 @@ module ScottKit
|
|
132
132
|
|
133
133
|
def parse_occur
|
134
134
|
match :occur
|
135
|
-
if peek == :
|
136
|
-
chance = match :
|
135
|
+
if peek == :percentage
|
136
|
+
chance = match :percentage
|
137
137
|
skip if peek == ":" # optional
|
138
138
|
else
|
139
139
|
chance = nil
|
@@ -214,6 +214,31 @@ module ScottKit
|
|
214
214
|
rooms = tree.rooms
|
215
215
|
items = tree.items
|
216
216
|
|
217
|
+
if (@game.options[:teleport])
|
218
|
+
rooms.each.with_index { |room, i|
|
219
|
+
next if i == 0
|
220
|
+
instructions = [
|
221
|
+
[ "print", "*** Fzing! ***" ],
|
222
|
+
[ "goto", room.name ],
|
223
|
+
[ "look" ]
|
224
|
+
]
|
225
|
+
tree.actions.push CAction.new('teleport', room.name, [],
|
226
|
+
instructions, '')
|
227
|
+
}
|
228
|
+
end
|
229
|
+
|
230
|
+
if (@game.options[:superget])
|
231
|
+
items.each.with_index { |item, i|
|
232
|
+
next if i == 0
|
233
|
+
instructions = [
|
234
|
+
[ "print", "*** Fzapp! ***" ],
|
235
|
+
[ "superget", item.name ],
|
236
|
+
]
|
237
|
+
tree.actions.push CAction.new('sg', item.name, [],
|
238
|
+
instructions, '')
|
239
|
+
}
|
240
|
+
end
|
241
|
+
|
217
242
|
if tree.lightsource then
|
218
243
|
# The light-source is always item #9, so swap as necessary
|
219
244
|
lindex = items.index { |x| x.name == tree.lightsource } or
|
@@ -642,7 +667,7 @@ module ScottKit
|
|
642
667
|
:symbol
|
643
668
|
elsif match = @buffer.match(/^(\d+)%/)
|
644
669
|
@lexeme, @buffer = match[1], match.post_match
|
645
|
-
:
|
670
|
+
:percentage
|
646
671
|
elsif match = @buffer.match(/^([!a-z_0-9-]+)/i)
|
647
672
|
@lexeme, @buffer = match[1], match.post_match
|
648
673
|
TOKENMAP[@lexeme] || :symbol
|
@@ -683,7 +708,7 @@ module ScottKit
|
|
683
708
|
lexeme
|
684
709
|
elsif token == :symbol
|
685
710
|
"\"#{lexeme}\""
|
686
|
-
elsif token == :
|
711
|
+
elsif token == :percentage
|
687
712
|
"'#{lexeme}%'"
|
688
713
|
else
|
689
714
|
nil
|
data/lib/scottkit/game.rb
CHANGED
@@ -16,8 +16,8 @@ module ScottKit
|
|
16
16
|
:maxload, :lamptime #:nodoc:
|
17
17
|
|
18
18
|
# Variable during run (but mostly set only within this class)
|
19
|
-
attr_reader :flags, :counters, :saved_rooms, :noun
|
20
|
-
attr_accessor :loc, :counter, :saved_room #:nodoc:
|
19
|
+
attr_reader :flags, :counters, :saved_rooms, :noun #:nodoc:
|
20
|
+
attr_accessor :loc, :counter, :saved_room, :lampleft #:nodoc:
|
21
21
|
|
22
22
|
private
|
23
23
|
|
data/lib/scottkit/play.rb
CHANGED
@@ -191,9 +191,9 @@ module ScottKit
|
|
191
191
|
def wizard_command(verb, noun)
|
192
192
|
optnames = {
|
193
193
|
"c" => :show_conditions,
|
194
|
-
"i"
|
195
|
-
"r"
|
196
|
-
"p"
|
194
|
+
"i" => :show_instructions,
|
195
|
+
"r" => :show_random,
|
196
|
+
"p" => :show_parse,
|
197
197
|
}
|
198
198
|
|
199
199
|
if verb.upcase == "#SG" # superget
|
data/manual/reference.md
CHANGED
@@ -495,9 +495,9 @@ may be nominated as "current" by the `select_counter` action.)
|
|
495
495
|
--
|
496
496
|
True if the current counter's value is _NUM_ or less.
|
497
497
|
|
498
|
-
* `
|
498
|
+
* `counter_gt` _NUM_
|
499
499
|
--
|
500
|
-
True if the current counter's value is _NUM_ or
|
500
|
+
True if the current counter's value is greater than _NUM_. Note the asymmetry here: you can check for less-than-or-equal, or strictly-greater-than; but not for strictly-less-than or greater-than-or-equal.
|
501
501
|
|
502
502
|
|
503
503
|
The sense of the
|
@@ -532,7 +532,7 @@ The following opcodes are supported:
|
|
532
532
|
|
533
533
|
* `print` _string_
|
534
534
|
--
|
535
|
-
Prints the specified string. Within that string, `\n` sequences are interpreted as newlines, and `\t` sequences as tabs.
|
535
|
+
Prints the specified string. Within that string, `\n` sequences are interpreted as newlines, and `\t` sequences as tabs. Since double-quotes are used to enclose the string, they may not appear within it. So backquotes (`` ` ``) are replaced by double quotes when they are printed.
|
536
536
|
|
537
537
|
* `goto` _room_
|
538
538
|
--
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scottkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ScottKit is a toolkit for compiling, decompiling and playing adventure
|
14
14
|
games in the Scott Adams format.
|
@@ -44,11 +44,12 @@ files:
|
|
44
44
|
- data/nosferatu/.gitignore
|
45
45
|
- data/nosferatu/Makefile
|
46
46
|
- data/nosferatu/README
|
47
|
+
- data/nosferatu/TODO
|
47
48
|
- data/nosferatu/nosferatu.map
|
48
49
|
- data/nosferatu/nosferatu.regression
|
49
50
|
- data/nosferatu/nosferatu.sck
|
50
|
-
- data/nosferatu/nosferatu.script
|
51
51
|
- data/nosferatu/nosferatu.sol
|
52
|
+
- data/nosferatu/nosferatu.transcript
|
52
53
|
- data/test/Makefile
|
53
54
|
- data/test/adams/Makefile
|
54
55
|
- data/test/adams/adv01.solution
|