gamefic-sdk 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/html/core/engine.js +16 -61
- data/html/sinatra/engine.js +51 -0
- data/html/skins/standard/index.html.erb +1 -1
- data/html/skins/standard/play.js +20 -4
- data/html/skins/standard/style.css +3 -0
- data/lib/gamefic-sdk.rb +2 -2
- data/lib/gamefic-sdk/debug/plot.rb +1 -1
- data/lib/gamefic-sdk/platform.rb +1 -0
- data/lib/gamefic-sdk/platform/sinatra.rb +100 -0
- data/lib/gamefic-sdk/platform/web.rb +19 -12
- data/lib/gamefic-sdk/platform/web/app_config.rb +5 -6
- data/lib/gamefic-sdk/platform/web/engine.rb +41 -0
- data/lib/gamefic-sdk/platform/web/user.rb +19 -0
- data/lib/gamefic-sdk/server.rb +67 -0
- data/lib/gamefic-sdk/shell.rb +50 -10
- data/lib/gamefic-sdk/shell/init.rb +7 -2
- data/lib/gamefic-sdk/version.rb +1 -1
- data/scripts/autosuggest.plot.rb +5 -11
- data/scripts/clothing/actions/wear.plot.rb +1 -1
- data/scripts/clothing/entities/clothing.plot.rb +1 -1
- data/scripts/clothing/entities/coat.plot.rb +1 -1
- data/scripts/clothing/entities/gloves.plot.rb +1 -1
- data/scripts/clothing/entities/hat.plot.rb +1 -1
- data/scripts/clothing/entities/pants.plot.rb +1 -1
- data/scripts/clothing/entities/shirt.plot.rb +1 -1
- data/scripts/clothing/entities/shoes.plot.rb +1 -1
- data/scripts/save-restore.plot.rb +1 -0
- data/scripts/snapshots.plot.rb +1 -1
- data/scripts/standard.plot.rb +1 -1
- data/scripts/standard/actions/close.plot.rb +2 -2
- data/scripts/standard/actions/drop.plot.rb +6 -2
- data/scripts/standard/actions/give.plot.rb +12 -17
- data/scripts/standard/actions/go.plot.rb +7 -6
- data/scripts/standard/actions/lock.plot.rb +3 -3
- data/scripts/standard/actions/look-under.plot.rb +1 -1
- data/scripts/standard/actions/look.plot.rb +13 -8
- data/scripts/standard/actions/nil.plot.rb +1 -1
- data/scripts/standard/actions/place.plot.rb +2 -1
- data/scripts/standard/actions/read.plot.rb +1 -1
- data/scripts/standard/actions/search.plot.rb +1 -0
- data/scripts/standard/actions/take.plot.rb +1 -1
- data/scripts/standard/actions/talk.plot.rb +4 -4
- data/scripts/standard/actions/unlock.plot.rb +6 -6
- data/scripts/standard/actions/use.plot.rb +4 -4
- data/scripts/standard/entities/character.plot.rb +0 -2
- data/scripts/standard/entities/container.plot.rb +1 -4
- data/scripts/standard/entities/door.plot.rb +1 -3
- data/scripts/standard/entities/entity.plot.rb +0 -1
- data/scripts/standard/entities/exterior.plot.rb +1 -1
- data/scripts/standard/entities/fixture.plot.rb +1 -1
- data/scripts/standard/entities/item.plot.rb +1 -1
- data/scripts/standard/entities/portal.plot.rb +2 -3
- data/scripts/standard/entities/receptacle.plot.rb +1 -2
- data/scripts/standard/entities/room.plot.rb +4 -6
- data/scripts/standard/entities/rubble.plot.rb +1 -1
- data/scripts/standard/entities/scenery.plot.rb +1 -1
- data/scripts/standard/entities/supporter.plot.rb +2 -2
- data/scripts/standard/modules/attachable.plot.rb +1 -1
- data/scripts/standard/modules/auto_takes.plot.rb +1 -1
- data/scripts/standard/modules/darkenable.plot.rb +1 -1
- data/scripts/standard/modules/enterable.plot.rb +1 -1
- data/scripts/standard/modules/explicit_exits.plot.rb +1 -1
- data/scripts/standard/modules/itemizable.plot.rb +1 -1
- data/scripts/standard/modules/lockable.plot.rb +1 -1
- data/scripts/standard/modules/openable.plot.rb +4 -1
- data/scripts/standard/modules/parent-room.plot.rb +1 -1
- data/scripts/standard/modules/portable.plot.rb +1 -1
- data/scripts/standard/modules/transparent.plot.rb +1 -1
- data/scripts/standard/plural/actions/place.plot.rb +2 -2
- data/scripts/standard/queries.plot.rb +21 -4
- data/scripts/standard/use.plot.rb +26 -8
- data/scripts/suggestible.plot.rb +17 -17
- metadata +58 -10
- data/lib/gamefic-sdk/platform/web/gamefic_opal.rb +0 -45
- data/scripts/standard/queries/from_expression.plot.rb +0 -16
- data/scripts/standard/queries/reachable.plot.rb +0 -48
- data/scripts/standard/queries/room.plot.rb +0 -17
- data/scripts/standard/queries/visible.plot.rb +0 -45
@@ -1,17 +0,0 @@
|
|
1
|
-
# This query resolves to the subject's room, as opposed to the parent. It's
|
2
|
-
# useful for making sure you target the room instead of a container or a
|
3
|
-
# supporter.
|
4
|
-
|
5
|
-
module Gamefic::Query
|
6
|
-
class Room < Parent
|
7
|
-
def context_from(subject)
|
8
|
-
[subject.room]
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module Gamefic::Use
|
14
|
-
def self.room *args
|
15
|
-
Gamefic::Query::Room.new *args
|
16
|
-
end
|
17
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# This query filters for objects that the player can see, regardless of
|
2
|
-
# whether they are reachable. It includes the following:
|
3
|
-
#
|
4
|
-
# * Siblings (other entities with the same parent)
|
5
|
-
# * The subject's children
|
6
|
-
# * Children of the subject's room (if room is not parent)
|
7
|
-
# * Entities on reachable supporters
|
8
|
-
# * Entities inside reachable open containers
|
9
|
-
# * Entities inside reachable transparent containers
|
10
|
-
# * Entities attached to reachable entities
|
11
|
-
|
12
|
-
module Gamefic::Query
|
13
|
-
class Visible < Family
|
14
|
-
def base_specificity
|
15
|
-
40
|
16
|
-
end
|
17
|
-
def context_from(subject)
|
18
|
-
array = super
|
19
|
-
array += subject.room.children
|
20
|
-
array.uniq!
|
21
|
-
array.each { |thing|
|
22
|
-
if thing.kind_of?(Container)
|
23
|
-
if thing.open? or thing.transparent?
|
24
|
-
array += thing.children.that_are_not(:attached?)
|
25
|
-
end
|
26
|
-
elsif thing.kind_of?(Supporter) or thing.kind_of?(Receptacle)
|
27
|
-
array += thing.children.that_are_not(:attached?)
|
28
|
-
end
|
29
|
-
thing.children.that_are(:attached?).each { |att|
|
30
|
-
array.push att
|
31
|
-
if att.kind_of?(Supporter) or (att.kind_of?(Container) and (att.open? or att.transparent?))
|
32
|
-
array += att.children.that_are_not(:attached?)
|
33
|
-
end
|
34
|
-
}
|
35
|
-
}
|
36
|
-
array - [subject]
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
module Gamefic::Use
|
42
|
-
def self.visible *args
|
43
|
-
Gamefic::Query::Visible.new *args
|
44
|
-
end
|
45
|
-
end
|