gamefic-standard 3.0.0 → 3.2.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 +7 -0
- data/Gemfile +0 -2
- data/gamefic-standard.gemspec +1 -1
- data/lib/gamefic-standard/actions/look.rb +1 -1
- data/lib/gamefic-standard/actions/nil.rb +2 -2
- data/lib/gamefic-standard/actions/pronouns.rb +28 -0
- data/lib/gamefic-standard/actions/repeat.rb +1 -1
- data/lib/gamefic-standard/actions/save-restore-undo.rb +3 -3
- data/lib/gamefic-standard/actions.rb +1 -0
- data/lib/gamefic-standard/modules.rb +1 -4
- data/lib/gamefic-standard/version.rb +1 -1
- data/lib/gamefic-standard.rb +0 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93e0b9232ad79263ae86444d04d4c9a4fefa4f1b4502d2fcb8275263fc6a9401
|
|
4
|
+
data.tar.gz: 0fcd39f5dbdd99d94fd9525d188e29ada3d89d0545e6dc2455d695e5faf060ea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d500f2938e3475dea1e00c926b3dcec159ba76565c435f8590a317a316883b3c5ad2e7a8e01dc26eff1f9393680af8c925db42e26e57ba2d31aebcf2c5b3071
|
|
7
|
+
data.tar.gz: 34bb09d0c1a814c6e2f6febc04a1e8b959b78d8b0a1a17ffb42477ba110f4880ff24707f62255cc9c73c6602476d63abb79d496d79dafe394d3af3b6d4a36389
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/gamefic-standard.gemspec
CHANGED
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
|
37
37
|
|
|
38
38
|
spec.required_ruby_version = '>= 2.7.0'
|
|
39
39
|
|
|
40
|
-
spec.add_dependency 'gamefic', '~> 3.
|
|
40
|
+
spec.add_dependency 'gamefic', '~> 3.1'
|
|
41
41
|
|
|
42
42
|
spec.add_development_dependency 'opal', '~> 1.7'
|
|
43
43
|
spec.add_development_dependency 'opal-rspec', '~> 1.0'
|
|
@@ -2,7 +2,7 @@ Gamefic::Standard.script do
|
|
|
2
2
|
meta nil, plaintext do |actor, string|
|
|
3
3
|
words = string.keywords
|
|
4
4
|
list = actor.epic.synonyms
|
|
5
|
-
if list.include?(words[0]
|
|
5
|
+
if list.include?(words[0]&.to_sym)
|
|
6
6
|
if words.length > 1
|
|
7
7
|
found = []
|
|
8
8
|
avail = available(ambiguous: true)
|
|
@@ -18,7 +18,7 @@ Gamefic::Standard.script do
|
|
|
18
18
|
elsif found.one?
|
|
19
19
|
actor.tell %(I recognize "#{words[0]}" and "#{found.first.name}" but could not understand them together.)
|
|
20
20
|
else
|
|
21
|
-
actor.tell %(I recognize "#{words[0]} I'm not sure if "#{words[1..-1].join(' ')}" means #{found.map(&:definitely).join_or}.)
|
|
21
|
+
actor.tell %(I recognize "#{words[0]}" but I'm not sure if "#{words[1..-1].join(' ')}" means #{found.map(&:definitely).join_or}.)
|
|
22
22
|
end
|
|
23
23
|
else
|
|
24
24
|
actor.tell %(I recognize "#{words[0]}" as a verb but could not understand it in this context.)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Gamefic::Standard.script do
|
|
4
|
+
introduction do |actor|
|
|
5
|
+
actor[:standard_pronoun_targets] = []
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
after_action do |action|
|
|
9
|
+
next unless action.verb
|
|
10
|
+
|
|
11
|
+
action.actor[:standard_pronoun_targets].replace action.arguments.that_are(Thing)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
meta nil, plaintext do |actor, string|
|
|
15
|
+
keywords = string.keywords
|
|
16
|
+
list = actor.epic.synonyms
|
|
17
|
+
next actor.proceed unless list.include?(keywords.first&.to_sym)
|
|
18
|
+
|
|
19
|
+
xlation = keywords[1..].map do |word|
|
|
20
|
+
next word unless %w[him her it them].include?(word)
|
|
21
|
+
|
|
22
|
+
actor[:standard_pronoun_targets].find { |obj| Grammar::Pronoun.objective(obj) == word }
|
|
23
|
+
end
|
|
24
|
+
next actor.proceed if xlation.any?(&:nil?) || xlation.that_are(Thing).empty?
|
|
25
|
+
|
|
26
|
+
actor.perform "#{keywords[0].to_sym} #{xlation.join(' ')}"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -4,15 +4,15 @@ Gamefic::Standard.script do
|
|
|
4
4
|
# Save, Restore, and Undo need to be handled by the game client. They have
|
|
5
5
|
# default implementations here to make them available in help.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
meta :save do |actor|
|
|
8
8
|
actor.tell "<kbd>Save</kbd> is not available."
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
meta :restore do |actor|
|
|
12
12
|
actor.tell "<kbd>Restore</kbd> is not available."
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
meta :undo do |actor|
|
|
16
16
|
actor.tell "<kbd>Undo</kbd> is not available."
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
# for plots and subplots. Examples include the `connect` method for creating
|
|
3
|
-
# portals between rooms.
|
|
4
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
5
2
|
|
|
6
3
|
require 'gamefic-standard/modules/standardized'
|
|
7
4
|
require 'gamefic-standard/modules/enterable'
|
data/lib/gamefic-standard.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gamefic-standard
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fred Snyder
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gamefic
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '3.
|
|
19
|
+
version: '3.1'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '3.
|
|
26
|
+
version: '3.1'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: opal
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -133,6 +133,7 @@ files:
|
|
|
133
133
|
- lib/gamefic-standard/actions/nil.rb
|
|
134
134
|
- lib/gamefic-standard/actions/open.rb
|
|
135
135
|
- lib/gamefic-standard/actions/place.rb
|
|
136
|
+
- lib/gamefic-standard/actions/pronouns.rb
|
|
136
137
|
- lib/gamefic-standard/actions/quit.rb
|
|
137
138
|
- lib/gamefic-standard/actions/repeat.rb
|
|
138
139
|
- lib/gamefic-standard/actions/save-restore-undo.rb
|