inform6lib 0.0.7 → 0.1.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.
- checksums.yaml +4 -4
- data/lib/inform/English.h.rb +5 -5
- data/lib/inform/VerbLib.h.rb +1 -1
- data/lib/inform/parserm.h.rb +6 -9
- data/lib/inform/verblibm.h.rb +7 -46
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c832fae34b158458f4ff2550832e9756033a725633750854d4afae675f915eab
|
|
4
|
+
data.tar.gz: 93ce34112c5b2c236ab1eb3aa0027ee8fce90e39249c1dc5b3d3d33310142e1a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57c086700bcaeef38381113c158c6922983e2918ede45937a04615efc4cd0286df39eb8d8dbad06dcdfa2496bdc41d747fe029d6b6ce91537cc57b193b6deae8
|
|
7
|
+
data.tar.gz: ddad647de642419cdf28a6b7c790a37dc443dd705bc62a017c9ef8334a6546d34a4d5ca9abdb6da8431244a05d74f37fa8e5661aaaa1f650afd310302ad8c543
|
data/lib/inform/English.h.rb
CHANGED
|
@@ -66,7 +66,7 @@ module English
|
|
|
66
66
|
# ------------------------------------------------------------------------------
|
|
67
67
|
|
|
68
68
|
# The CompassDirection class
|
|
69
|
-
class CompassDirection < Inform::
|
|
69
|
+
class CompassDirection < Inform::Ephemeral::Object
|
|
70
70
|
def initialize(name, number = 0, article = "the")
|
|
71
71
|
super(name)
|
|
72
72
|
@number = number
|
|
@@ -75,7 +75,7 @@ module English
|
|
|
75
75
|
end
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
Compass = Inform::
|
|
78
|
+
Compass = Inform::Ephemeral::Object.new "compass"
|
|
79
79
|
Compass.has :concealed
|
|
80
80
|
|
|
81
81
|
Compass > $n_obj = CompassDirection.new("north") {
|
|
@@ -1268,9 +1268,9 @@ if defined? Inform::Object
|
|
|
1268
1268
|
include Inform::English
|
|
1269
1269
|
end
|
|
1270
1270
|
|
|
1271
|
-
# The Inform::
|
|
1272
|
-
module
|
|
1273
|
-
# The Inform::
|
|
1271
|
+
# The Inform::Ephemeral module
|
|
1272
|
+
module Ephemeral
|
|
1273
|
+
# The Inform::Ephemeral::Object class to include the English module
|
|
1274
1274
|
class Object
|
|
1275
1275
|
include Inform::English
|
|
1276
1276
|
end
|
data/lib/inform/VerbLib.h.rb
CHANGED
data/lib/inform/parserm.h.rb
CHANGED
|
@@ -504,7 +504,7 @@ module Parser
|
|
|
504
504
|
# location-name on the status line can be "Darkness".
|
|
505
505
|
# ----------------------------------------------------------------------------
|
|
506
506
|
|
|
507
|
-
Darkness = Inform::
|
|
507
|
+
Darkness = Inform::Ephemeral::Object.new "(darkness object)"
|
|
508
508
|
Darkness.with do
|
|
509
509
|
def short_name; DARKNESS__TX; end
|
|
510
510
|
def description; L__M(:Miscellany, 17); end
|
|
@@ -574,7 +574,7 @@ module Parser
|
|
|
574
574
|
#
|
|
575
575
|
# ----------------------------------------------------------------------------
|
|
576
576
|
|
|
577
|
-
# InformParser = Inform::
|
|
577
|
+
# InformParser = Inform::Ephemeral::Object.new "(Inform Parser)"
|
|
578
578
|
# def InformParser.parse_input; Parser__parse(); end
|
|
579
579
|
# InformParser.has :proper
|
|
580
580
|
|
|
@@ -4676,7 +4676,7 @@ module Parser
|
|
|
4676
4676
|
|
|
4677
4677
|
# artform = LanguageArticles
|
|
4678
4678
|
# + 3*WORDSIZE*LanguageContractionForms*(short_name_case + i*LanguageCases);You can see acode: 2
|
|
4679
|
-
# TODO: Remove
|
|
4679
|
+
# TODO: Remove
|
|
4680
4680
|
# print "acode: ", acode, "^";
|
|
4681
4681
|
# print "artform-->acode: ", (string) (artform-->acode), "^";
|
|
4682
4682
|
# print "artform-->0: ", (string) (artform-->0), "^";
|
|
@@ -5174,13 +5174,10 @@ end
|
|
|
5174
5174
|
|
|
5175
5175
|
# The InformLibrary class.
|
|
5176
5176
|
# Inform 6 defines this as an Object.
|
|
5177
|
-
class InformLibrary < Inform::
|
|
5177
|
+
class InformLibrary < Inform::Ephemeral::Object
|
|
5178
5178
|
REGISTRY = Struct.new(:memo).new(defined?(Java) ? java.util.concurrent.ConcurrentHashMap.new : {})
|
|
5179
|
-
include Inform::Context
|
|
5180
|
-
include Inform::StdLib
|
|
5181
|
-
include Inform::Parser
|
|
5182
5179
|
include Inform::Rules
|
|
5183
|
-
include Inform::
|
|
5180
|
+
include Inform::Parser
|
|
5184
5181
|
|
|
5185
5182
|
attr_accessor :player
|
|
5186
5183
|
|
|
@@ -5842,7 +5839,7 @@ module Inform
|
|
|
5842
5839
|
end
|
|
5843
5840
|
|
|
5844
5841
|
# The LibExt class
|
|
5845
|
-
class LibExt < Inform::
|
|
5842
|
+
class LibExt < Inform::Ephemeral::Object
|
|
5846
5843
|
attr_accessor :ext_initialise, :ext_messages
|
|
5847
5844
|
|
|
5848
5845
|
def init
|
data/lib/inform/verblibm.h.rb
CHANGED
|
@@ -1034,7 +1034,7 @@ module Verbs
|
|
|
1034
1034
|
# of using Netty.
|
|
1035
1035
|
def YesOrNo
|
|
1036
1036
|
loop do
|
|
1037
|
-
@input =
|
|
1037
|
+
@input = __read
|
|
1038
1038
|
DrawStatusLine() if !location.nil? && !parent(@player).nil?
|
|
1039
1039
|
j = @input
|
|
1040
1040
|
unless @input.empty? # at least one word entered
|
|
@@ -1359,7 +1359,6 @@ module Verbs
|
|
|
1359
1359
|
|
|
1360
1360
|
# Transfer the item.
|
|
1361
1361
|
|
|
1362
|
-
@player.publish L__M(:Take, 15, noun)
|
|
1363
1362
|
move item, @player
|
|
1364
1363
|
|
|
1365
1364
|
# Send "after" message to the object letting go of the item, if any.
|
|
@@ -1413,7 +1412,6 @@ module Verbs
|
|
|
1413
1412
|
move noun, @player.parent
|
|
1414
1413
|
return true if AfterRoutines()
|
|
1415
1414
|
return true if @keep_silent
|
|
1416
|
-
@player.publish L__M(:Drop, 5, noun)
|
|
1417
1415
|
return L__M(:Drop, 4, noun)
|
|
1418
1416
|
end
|
|
1419
1417
|
|
|
@@ -1453,7 +1451,6 @@ module Verbs
|
|
|
1453
1451
|
@action = :PutOn
|
|
1454
1452
|
end
|
|
1455
1453
|
return if @keep_silent
|
|
1456
|
-
@player.publish L__M(:PutOn, 9, noun)
|
|
1457
1454
|
return L__M(:PutOn, 7) if @multiflag
|
|
1458
1455
|
L__M(:PutOn, 8, noun)
|
|
1459
1456
|
end
|
|
@@ -1496,7 +1493,6 @@ module Verbs
|
|
|
1496
1493
|
@action = :Insert
|
|
1497
1494
|
end
|
|
1498
1495
|
return true if @keep_silent
|
|
1499
|
-
@player.publish L__M(:Insert, 10, noun)
|
|
1500
1496
|
return L__M(:Insert, 8, noun) if @multiflag
|
|
1501
1497
|
L__M(:Insert, 9, noun)
|
|
1502
1498
|
end
|
|
@@ -1556,7 +1552,6 @@ module Verbs
|
|
|
1556
1552
|
def GiveSub
|
|
1557
1553
|
return L__M(:Give, 1, noun) if parent(noun) != @player
|
|
1558
1554
|
if second == @player
|
|
1559
|
-
@player.publish A(player) + " juggles " + a(noun) + " for a second or two."
|
|
1560
1555
|
return L__M(:Give, 2, noun)
|
|
1561
1556
|
end
|
|
1562
1557
|
return false if RunLife(second, :Give)
|
|
@@ -1619,7 +1614,6 @@ module Verbs
|
|
|
1619
1614
|
return true if AfterRoutines()
|
|
1620
1615
|
return true if @keep_silent
|
|
1621
1616
|
Locale(noun)
|
|
1622
|
-
@player.publish L__M(:Enter, 8, noun)
|
|
1623
1617
|
L__M(:Enter, 5, noun)
|
|
1624
1618
|
end
|
|
1625
1619
|
|
|
@@ -1644,7 +1638,6 @@ module Verbs
|
|
|
1644
1638
|
|
|
1645
1639
|
return true if AfterRoutines()
|
|
1646
1640
|
return true if @keep_silent
|
|
1647
|
-
@player.publish L__M(:Exit, 5, parent_obj)
|
|
1648
1641
|
L__M(:Exit, 3, parent_obj)
|
|
1649
1642
|
LookSub(true)
|
|
1650
1643
|
end
|
|
@@ -1704,7 +1697,6 @@ module Verbs
|
|
|
1704
1697
|
end
|
|
1705
1698
|
|
|
1706
1699
|
orig_loc = @real_location
|
|
1707
|
-
@player.publish L__M(:Go, 7, noun) unless @keep_silent
|
|
1708
1700
|
|
|
1709
1701
|
if movewith.nil? then move @player, j else move movewith, j end
|
|
1710
1702
|
|
|
@@ -1729,8 +1721,6 @@ module Verbs
|
|
|
1729
1721
|
@location = thedark; @lightflag = false
|
|
1730
1722
|
end
|
|
1731
1723
|
|
|
1732
|
-
@player.publish L__M(:Go, 8, ArrivalDir(j, orig_loc)) unless @keep_silent
|
|
1733
|
-
|
|
1734
1724
|
return true if AfterRoutines()
|
|
1735
1725
|
return true if @keep_silent
|
|
1736
1726
|
LookSub(true)
|
|
@@ -2012,17 +2002,6 @@ module Verbs
|
|
|
2012
2002
|
unless @keep_silent
|
|
2013
2003
|
if noun.has? :animate
|
|
2014
2004
|
@action = :LookAt
|
|
2015
|
-
if noun.in?(@player)
|
|
2016
|
-
@player.publish A(@player) + " looks at " + hisorher(@player, noun) + "."
|
|
2017
|
-
elsif noun != @player
|
|
2018
|
-
@player.publish A(@player) + " looks over at " + a(noun) + "."
|
|
2019
|
-
end
|
|
2020
|
-
else
|
|
2021
|
-
if noun.in?(@player)
|
|
2022
|
-
@player.publish A(@player) + " examines " + hisorher(@player, noun) + "."
|
|
2023
|
-
else
|
|
2024
|
-
@player.publish A(@player) + " examines " + a(noun) + "."
|
|
2025
|
-
end
|
|
2026
2005
|
end
|
|
2027
2006
|
end
|
|
2028
2007
|
i = noun.description
|
|
@@ -2039,7 +2018,6 @@ module Verbs
|
|
|
2039
2018
|
|
|
2040
2019
|
def LookUnderSub
|
|
2041
2020
|
return L__M(:LookUnder, 1) if @location == thedark
|
|
2042
|
-
@player.publish L__M(:LookUnder, 3, noun)
|
|
2043
2021
|
L__M(:LookUnder, 2)
|
|
2044
2022
|
end
|
|
2045
2023
|
|
|
@@ -2052,7 +2030,6 @@ module Verbs
|
|
|
2052
2030
|
return if ObjectIsUntouchable(noun)
|
|
2053
2031
|
f = VisibleContents(noun)
|
|
2054
2032
|
if noun.has? :supporter
|
|
2055
|
-
@player.publish L__M(:Search, 8, noun) unless @keep_silent
|
|
2056
2033
|
return L__M(:Search, 2, noun) if f == 0
|
|
2057
2034
|
return L__M(:Search, 3, noun)
|
|
2058
2035
|
end
|
|
@@ -2060,7 +2037,6 @@ module Verbs
|
|
|
2060
2037
|
return L__M(:Search, 5, noun) if noun.hasnt?(:transparent) && noun.hasnt?(:open)
|
|
2061
2038
|
return true if AfterRoutines()
|
|
2062
2039
|
|
|
2063
|
-
@player.publish L__M(:Search, 8, noun) unless @keep_silent
|
|
2064
2040
|
return L__M(:Search, 6, noun) if f == 0
|
|
2065
2041
|
L__M(:Search, 7, noun)
|
|
2066
2042
|
end
|
|
@@ -2077,7 +2053,6 @@ module Verbs
|
|
|
2077
2053
|
take noun, :locked
|
|
2078
2054
|
return true if AfterRoutines()
|
|
2079
2055
|
return true if @keep_silent
|
|
2080
|
-
@player.publish L__M(:Unlock, 5, noun)
|
|
2081
2056
|
L__M(:Unlock, 4, noun)
|
|
2082
2057
|
end
|
|
2083
2058
|
|
|
@@ -2090,7 +2065,6 @@ module Verbs
|
|
|
2090
2065
|
give noun, :locked
|
|
2091
2066
|
return true if AfterRoutines()
|
|
2092
2067
|
return true if @keep_silent
|
|
2093
|
-
@player.publish L__M(:Lock, 6, noun)
|
|
2094
2068
|
L__M(:Lock, 5, noun)
|
|
2095
2069
|
end
|
|
2096
2070
|
|
|
@@ -2101,7 +2075,6 @@ module Verbs
|
|
|
2101
2075
|
give noun, :on
|
|
2102
2076
|
return true if AfterRoutines()
|
|
2103
2077
|
return true if @keep_silent
|
|
2104
|
-
@player.publish L__M(:SwitchOn, 4, noun)
|
|
2105
2078
|
L__M(:SwitchOn, 3, noun)
|
|
2106
2079
|
end
|
|
2107
2080
|
|
|
@@ -2112,7 +2085,6 @@ module Verbs
|
|
|
2112
2085
|
take noun, :on
|
|
2113
2086
|
return true if AfterRoutines()
|
|
2114
2087
|
return true if @keep_silent
|
|
2115
|
-
@player.publish L__M(:SwitchOff, 4, noun)
|
|
2116
2088
|
L__M(:SwitchOff, 3, noun)
|
|
2117
2089
|
end
|
|
2118
2090
|
|
|
@@ -2124,7 +2096,6 @@ module Verbs
|
|
|
2124
2096
|
give noun, :open
|
|
2125
2097
|
return true if AfterRoutines()
|
|
2126
2098
|
return true if @keep_silent
|
|
2127
|
-
@player.publish L__M(:Open, 6, noun)
|
|
2128
2099
|
if noun.has?(:container) && noun.hasnt?(:transparent) &&
|
|
2129
2100
|
@location != thedark &&
|
|
2130
2101
|
VisibleContents(noun) != 0 && IndirectlyContains(noun, @player)
|
|
@@ -2140,7 +2111,6 @@ module Verbs
|
|
|
2140
2111
|
take noun, :open
|
|
2141
2112
|
return true if AfterRoutines()
|
|
2142
2113
|
return true if @keep_silent
|
|
2143
|
-
@player.publish L__M(:Close, 4, noun)
|
|
2144
2114
|
L__M(:Close, 3, noun)
|
|
2145
2115
|
end
|
|
2146
2116
|
|
|
@@ -2150,7 +2120,6 @@ module Verbs
|
|
|
2150
2120
|
take noun, :worn
|
|
2151
2121
|
return true if AfterRoutines()
|
|
2152
2122
|
return true if @keep_silent
|
|
2153
|
-
@player.publish L__M(:Disrobe, 3, noun)
|
|
2154
2123
|
L__M(:Disrobe, 2, noun)
|
|
2155
2124
|
end
|
|
2156
2125
|
|
|
@@ -2162,7 +2131,6 @@ module Verbs
|
|
|
2162
2131
|
give noun, :worn
|
|
2163
2132
|
return true if AfterRoutines()
|
|
2164
2133
|
return true if @keep_silent
|
|
2165
|
-
@player.publish L__M(:Wear, 5, noun)
|
|
2166
2134
|
L__M(:Wear, 4, noun)
|
|
2167
2135
|
end
|
|
2168
2136
|
|
|
@@ -2177,7 +2145,6 @@ module Verbs
|
|
|
2177
2145
|
noun.destroy
|
|
2178
2146
|
return true if AfterRoutines()
|
|
2179
2147
|
return true if @keep_silent
|
|
2180
|
-
@player.publish L__M(:Eat, 3, noun)
|
|
2181
2148
|
L__M(:Eat, 2, noun)
|
|
2182
2149
|
end
|
|
2183
2150
|
|
|
@@ -2285,19 +2252,19 @@ module Verbs
|
|
|
2285
2252
|
L__M(:PushDir, 1, noun)
|
|
2286
2253
|
end
|
|
2287
2254
|
|
|
2288
|
-
def RubSub;
|
|
2255
|
+
def RubSub; L__M(:Rub, 1, noun); end
|
|
2289
2256
|
|
|
2290
2257
|
def SetSub; L__M(:Set, 1, noun); end
|
|
2291
2258
|
|
|
2292
2259
|
def SetToSub; L__M(:SetTo, 1, noun); end
|
|
2293
2260
|
|
|
2294
|
-
def SingSub;
|
|
2261
|
+
def SingSub; L__M(:Sing, 1, noun); end
|
|
2295
2262
|
|
|
2296
|
-
def SleepSub;
|
|
2263
|
+
def SleepSub; L__M(:Sleep, 1, noun); end
|
|
2297
2264
|
|
|
2298
|
-
def SmellSub;
|
|
2265
|
+
def SmellSub; L__M(:Smell, 1, noun); end
|
|
2299
2266
|
|
|
2300
|
-
def SorrySub;
|
|
2267
|
+
def SorrySub; L__M(:Sorry, 1, noun); end
|
|
2301
2268
|
|
|
2302
2269
|
def SqueezeSub
|
|
2303
2270
|
return if ObjectIsUntouchable(noun)
|
|
@@ -2321,7 +2288,6 @@ module Verbs
|
|
|
2321
2288
|
end
|
|
2322
2289
|
|
|
2323
2290
|
def ThinkSub
|
|
2324
|
-
@player.publish L__M(:Think, 2, noun)
|
|
2325
2291
|
L__M(:Think, 1, noun)
|
|
2326
2292
|
end
|
|
2327
2293
|
|
|
@@ -2350,7 +2316,6 @@ module Verbs
|
|
|
2350
2316
|
return L__M(:Touch, 3, noun) if noun == @player
|
|
2351
2317
|
return if ObjectIsUntouchable(noun)
|
|
2352
2318
|
return L__M(:Touch, 1, noun) if noun.has? :animate
|
|
2353
|
-
@player.publish L__M(:Touch,4,noun)
|
|
2354
2319
|
L__M(:Touch,2,noun)
|
|
2355
2320
|
end
|
|
2356
2321
|
|
|
@@ -2363,7 +2328,6 @@ module Verbs
|
|
|
2363
2328
|
end
|
|
2364
2329
|
|
|
2365
2330
|
def WaitSub
|
|
2366
|
-
@player.publish L__M(:Wait, 2, noun)
|
|
2367
2331
|
return true if AfterRoutines()
|
|
2368
2332
|
L__M(:Wait, 1, noun)
|
|
2369
2333
|
end
|
|
@@ -2378,16 +2342,13 @@ module Verbs
|
|
|
2378
2342
|
|
|
2379
2343
|
def WaveSub
|
|
2380
2344
|
return L__M(:Wave, 1, noun) if !noun.nil? && (noun.has?(:clothing, :worn) || noun.notin?(@player))
|
|
2381
|
-
@player.publish L__M(:Wave, 3, noun)
|
|
2382
2345
|
L__M(:Wave, 2, noun)
|
|
2383
2346
|
end
|
|
2384
2347
|
|
|
2385
2348
|
def WaveHandsSub
|
|
2386
2349
|
if noun
|
|
2387
|
-
@player.publish L__M(:WaveHands, 4, noun)
|
|
2388
2350
|
L__M(:WaveHands, 3, noun)
|
|
2389
2351
|
else
|
|
2390
|
-
@player.publish L__M(:WaveHands, 2, noun)
|
|
2391
2352
|
L__M(:WaveHands, 1, noun)
|
|
2392
2353
|
end
|
|
2393
2354
|
end
|
|
@@ -2399,7 +2360,7 @@ module Verbs
|
|
|
2399
2360
|
# ----------------------------------------------------------------------------
|
|
2400
2361
|
|
|
2401
2362
|
def XTestMove(obj, dest)
|
|
2402
|
-
if obj.is_a?(InformLibrary) || obj == LibraryMessages || obj.is_a?(Inform::
|
|
2363
|
+
if obj.is_a?(InformLibrary) || obj == LibraryMessages || obj.is_a?(Inform::Ephemeral::Object)
|
|
2403
2364
|
println "[Can't move #{obj.name}: it's a system object.]"
|
|
2404
2365
|
return true
|
|
2405
2366
|
end
|