gamefic-sdk 1.6.0 → 1.7.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/html/core/engine.js +89 -20
- data/html/sinatra/engine.js +27 -13
- data/html/skins/hypertext/index.html +0 -2
- data/html/skins/standard/play.js +0 -66
- data/lib/gamefic-sdk.rb +2 -1
- data/lib/gamefic-sdk/build.rb +11 -19
- data/lib/gamefic-sdk/config.rb +126 -0
- data/lib/gamefic-sdk/platform.rb +12 -0
- data/lib/gamefic-sdk/platform/base.rb +35 -33
- data/lib/gamefic-sdk/platform/gfic.rb +5 -18
- data/lib/gamefic-sdk/platform/sinatra.rb +29 -31
- data/lib/gamefic-sdk/platform/web.rb +72 -65
- data/lib/gamefic-sdk/platform/web/app_config.rb +48 -48
- data/lib/gamefic-sdk/platform/web/engine.rb +10 -7
- data/lib/gamefic-sdk/platform/web/user.rb +3 -3
- data/lib/gamefic-sdk/server.rb +17 -19
- data/lib/gamefic-sdk/shell.rb +68 -16
- data/lib/gamefic-sdk/shell/init.rb +3 -19
- data/lib/gamefic-sdk/shell/test.rb +9 -14
- data/lib/gamefic-sdk/version.rb +1 -1
- data/scripts/save-restore-undo.plot.rb +25 -0
- data/scripts/snapshots.plot.rb +16 -14
- data/scripts/standard.plot.rb +3 -5
- data/scripts/standard/actions.plot.rb +1 -11
- data/scripts/standard/actions/drop.plot.rb +1 -1
- data/scripts/standard/actions/enter.plot.rb +4 -16
- data/scripts/standard/actions/go.plot.rb +2 -36
- data/scripts/standard/actions/insert.plot.rb +7 -21
- data/scripts/standard/actions/inventory.plot.rb +2 -1
- data/scripts/standard/actions/leave.plot.rb +7 -18
- data/scripts/standard/actions/look.plot.rb +45 -44
- data/scripts/standard/actions/nil.plot.rb +1 -1
- data/scripts/standard/actions/take.plot.rb +10 -28
- data/scripts/standard/actions/talk.plot.rb +9 -13
- data/scripts/standard/clothing.plot.rb +4 -0
- data/scripts/standard/clothing/actions.plot.rb +4 -0
- data/scripts/{clothing → standard/clothing}/actions/doff.plot.rb +0 -0
- data/scripts/{clothing → standard/clothing}/actions/drop.plot.rb +8 -8
- data/scripts/{clothing → standard/clothing}/actions/inventory.plot.rb +14 -14
- data/scripts/standard/clothing/actions/wear.plot.rb +20 -0
- data/scripts/standard/clothing/entities.plot.rb +7 -0
- data/scripts/{clothing → standard/clothing}/entities/clothing.plot.rb +0 -2
- data/scripts/standard/clothing/entities/coat.plot.rb +3 -0
- data/scripts/standard/clothing/entities/gloves.plot.rb +3 -0
- data/scripts/standard/clothing/entities/hat.plot.rb +3 -0
- data/scripts/standard/clothing/entities/pants.plot.rb +3 -0
- data/scripts/standard/clothing/entities/shirt.plot.rb +3 -0
- data/scripts/standard/clothing/entities/shoes.plot.rb +3 -0
- data/scripts/standard/container.plot.rb +28 -0
- data/scripts/{debug.plot.rb → standard/container/actions.plot.rb} +0 -0
- data/scripts/standard/container/entities.plot.rb +5 -0
- data/scripts/standard/direction.plot.rb +1 -2
- data/scripts/{edible.plot.rb → standard/edible.plot.rb} +5 -3
- data/scripts/standard/entities.plot.rb +3 -3
- data/scripts/standard/entities/character.plot.rb +9 -6
- data/scripts/standard/entities/fixture.plot.rb +1 -1
- data/scripts/standard/entities/item.plot.rb +2 -4
- data/scripts/standard/entities/portal.plot.rb +9 -5
- data/scripts/standard/entities/receptacle.plot.rb +1 -1
- data/scripts/standard/entities/room.plot.rb +5 -5
- data/scripts/standard/entities/scenery.plot.rb +2 -4
- data/scripts/standard/entities/supporter.plot.rb +4 -7
- data/scripts/standard/entities/thing.plot.rb +7 -0
- data/scripts/standard/{actions/give.plot.rb → give.plot.rb} +27 -25
- data/scripts/standard/lockable.plot.rb +79 -0
- data/scripts/standard/modules.plot.rb +2 -4
- data/scripts/standard/modules/attachable.plot.rb +1 -0
- data/scripts/standard/modules/locale_description.plot.rb +20 -0
- data/scripts/standard/{use.plot.rb → modules/use.plot.rb} +51 -47
- data/scripts/standard/openable.plot.rb +43 -0
- data/scripts/standard/pathfinder.plot.rb +11 -6
- data/scripts/standard/test.plot.rb +2 -0
- data/scripts/undo.plot.rb +13 -11
- metadata +30 -65
- data/lib/gamefic-sdk/plot_config.rb +0 -25
- data/scripts/ansi.plot.rb +0 -13
- data/scripts/autosuggest.plot.rb +0 -165
- data/scripts/clothing.plot.rb +0 -2
- data/scripts/clothing/actions.plot.rb +0 -4
- data/scripts/clothing/actions/wear.plot.rb +0 -19
- data/scripts/clothing/entities.plot.rb +0 -7
- data/scripts/clothing/entities/coat.plot.rb +0 -5
- data/scripts/clothing/entities/gloves.plot.rb +0 -5
- data/scripts/clothing/entities/hat.plot.rb +0 -5
- data/scripts/clothing/entities/pants.plot.rb +0 -5
- data/scripts/clothing/entities/shirt.plot.rb +0 -5
- data/scripts/clothing/entities/shoes.plot.rb +0 -5
- data/scripts/cover.plot.rb +0 -30
- data/scripts/furniture.plot.rb +0 -35
- data/scripts/hints.plot.rb +0 -31
- data/scripts/hypertext.plot.rb +0 -280
- data/scripts/media.plot.rb +0 -17
- data/scripts/multimedia.plot.rb +0 -41
- data/scripts/questions.plot.rb +0 -17
- data/scripts/room-modes.plot.rb +0 -48
- data/scripts/rough-sizes.plot.rb +0 -36
- data/scripts/save-restore.plot.rb +0 -22
- data/scripts/standard/actions/close.plot.rb +0 -16
- data/scripts/standard/actions/lock.plot.rb +0 -59
- data/scripts/standard/actions/look-under.plot.rb +0 -8
- data/scripts/standard/actions/open.plot.rb +0 -34
- data/scripts/standard/actions/read.plot.rb +0 -3
- data/scripts/standard/actions/search.plot.rb +0 -40
- data/scripts/standard/actions/show.plot.rb +0 -13
- data/scripts/standard/actions/unlock.plot.rb +0 -77
- data/scripts/standard/actions/use.plot.rb +0 -25
- data/scripts/standard/entities/container.plot.rb +0 -8
- data/scripts/standard/entities/door.plot.rb +0 -51
- data/scripts/standard/entities/entity.plot.rb +0 -12
- data/scripts/standard/entities/exterior.plot.rb +0 -5
- data/scripts/standard/modules/darkenable.plot.rb +0 -6
- data/scripts/standard/modules/lockable.plot.rb +0 -25
- data/scripts/standard/modules/openable.plot.rb +0 -15
- data/scripts/standard/modules/transparent.plot.rb +0 -6
- data/scripts/standard/plural.plot.rb +0 -2
- data/scripts/standard/plural/actions.plot.rb +0 -4
- data/scripts/standard/plural/actions/drop.plot.rb +0 -126
- data/scripts/standard/plural/actions/insert.plot.rb +0 -60
- data/scripts/standard/plural/actions/place.plot.rb +0 -37
- data/scripts/standard/plural/actions/take.plot.rb +0 -175
- data/scripts/standard/plural/queries.plot.rb +0 -5
- data/scripts/standard/plural/queries/ambiguous_visible.plot.rb +0 -13
- data/scripts/standard/plural/queries/any_expression.plot.rb +0 -17
- data/scripts/standard/plural/queries/many_visible.plot.rb +0 -13
- data/scripts/standard/plural/queries/not_expression.plot.rb +0 -16
- data/scripts/standard/plural/queries/plural_visible.plot.rb +0 -22
- data/scripts/suggestible.plot.rb +0 -54
@@ -1,13 +0,0 @@
|
|
1
|
-
script 'standard/plural/queries/many_visible'
|
2
|
-
|
3
|
-
class Gamefic::Query::AmbiguousVisible < Gamefic::Query::ManyVisible
|
4
|
-
def allow_ambiguous?
|
5
|
-
true
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
module Gamefic::Use
|
10
|
-
def self.ambiguous_visible *args
|
11
|
-
Gamefic::Query::AmbiguousVisible.new *args
|
12
|
-
end
|
13
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class Gamefic::Query::AnyExpression < Gamefic::Query::Expression
|
2
|
-
def initialize()
|
3
|
-
super(
|
4
|
-
/^(all|everything|every|anything|any|each|things|stuff)( (that|which) (is|are))?$/,
|
5
|
-
/^all of$/,
|
6
|
-
)
|
7
|
-
end
|
8
|
-
def signature
|
9
|
-
"#{self.class}"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module Gamefic::Use
|
14
|
-
def self.any_expression
|
15
|
-
Gamefic::Query::AnyExpression.new
|
16
|
-
end
|
17
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class Gamefic::Query::NotExpression < Gamefic::Query::Expression
|
2
|
-
def initialize
|
3
|
-
super(
|
4
|
-
/^(all|everything|every|anything|any|each|things|stuff)( (that|which) (is|are))? not$/
|
5
|
-
)
|
6
|
-
end
|
7
|
-
def signature
|
8
|
-
"#{self.class}"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
module Gamefic::Use
|
13
|
-
def self.not_expression
|
14
|
-
Gamefic::Query::NotExpression.new
|
15
|
-
end
|
16
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
script 'standard/plural/queries/ambiguous_visible'
|
2
|
-
|
3
|
-
class Gamefic::Query::PluralVisible < Gamefic::Query::AmbiguousVisible
|
4
|
-
def execute(subject, description)
|
5
|
-
if (!description.end_with?("s") and !description.end_with?("i") and !description.end_with?("ae")) or (description.end_with?("ous") or description.end_with?("ess"))
|
6
|
-
return Gamefic::Query::Matches.new([], '', description)
|
7
|
-
end
|
8
|
-
super
|
9
|
-
end
|
10
|
-
def validate(subject, object)
|
11
|
-
# Plural queries always return false on validation. Their only purpose is
|
12
|
-
# to provide syntactic sugar for plural nouns, so it should never get triggered
|
13
|
-
# by a token call.
|
14
|
-
false
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
module Gamefic::Use
|
19
|
-
def self.plural_visible *args
|
20
|
-
Gamefic::Query::PluralVisible.new *args
|
21
|
-
end
|
22
|
-
end
|
data/scripts/suggestible.plot.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
class Gamefic::Suggestions
|
2
|
-
def current
|
3
|
-
@current ||= []
|
4
|
-
end
|
5
|
-
|
6
|
-
def previous
|
7
|
-
@previous ||= []
|
8
|
-
end
|
9
|
-
|
10
|
-
def update
|
11
|
-
previous.clear
|
12
|
-
previous.concat current
|
13
|
-
current.clear
|
14
|
-
end
|
15
|
-
|
16
|
-
def clear
|
17
|
-
previous.clear
|
18
|
-
current.clear
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
module Gamefic::Suggestible
|
23
|
-
def suggestions
|
24
|
-
@suggestions ||= Gamefic::Suggestions.new
|
25
|
-
end
|
26
|
-
|
27
|
-
def suggest command
|
28
|
-
suggestions.current.push command unless suggestions.current.include? command
|
29
|
-
end
|
30
|
-
|
31
|
-
def state
|
32
|
-
super.merge(suggestions: suggestions.current.map{|s| s.cap_first})
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Gamefic::Character
|
37
|
-
include Suggestible
|
38
|
-
end
|
39
|
-
|
40
|
-
before_player_update do |player|
|
41
|
-
if player.scene == default_scene or player.next_scene == default_scene
|
42
|
-
player.suggestions.update
|
43
|
-
else
|
44
|
-
player.suggestions.clear
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
respond :suggest do |actor|
|
49
|
-
actor.stream '<ul>'
|
50
|
-
actor.suggestions.previous.sort.each { |s|
|
51
|
-
actor.stream "<li>#{s}</li>"
|
52
|
-
}
|
53
|
-
actor.stream '</ul>'
|
54
|
-
end
|