gamefic-sdk 1.7.0 → 2.0.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 +5 -5
- data/bin/gamefic +16 -0
- data/lib/gamefic-sdk.rb +4 -24
- data/lib/gamefic-sdk/diagram.rb +205 -0
- data/lib/gamefic-sdk/scaffold.rb +54 -0
- data/lib/gamefic-sdk/server.rb +81 -65
- data/lib/gamefic-sdk/shell.rb +22 -129
- data/lib/gamefic-sdk/tasks.rb +40 -0
- data/lib/gamefic-sdk/tasks/common.rb +21 -0
- data/lib/gamefic-sdk/tasks/ruby.rb +99 -0
- data/lib/gamefic-sdk/tasks/web.rb +82 -0
- data/lib/gamefic-sdk/version.rb +5 -5
- metadata +123 -139
- data/bin/gfk +0 -6
- data/html/core/engine.js +0 -114
- data/html/core/jquery.js +0 -5
- data/html/core/jquery.modal.css +0 -44
- data/html/core/jquery.modal.js +0 -225
- data/html/core/js.cookie.js +0 -137
- data/html/sinatra/engine.js +0 -65
- data/html/skins/hypertext/compass.png +0 -0
- data/html/skins/hypertext/index.html +0 -149
- data/html/skins/hypertext/style.css +0 -74
- data/html/skins/minimal/index.html.erb +0 -22
- data/html/skins/minimal/index.rb +0 -4
- data/html/skins/minimal/play.js +0 -36
- data/html/skins/minimal/style.css +0 -8
- data/html/skins/multimedia/close.png +0 -0
- data/html/skins/multimedia/index.html +0 -179
- data/html/skins/multimedia/mobile.css +0 -10
- data/html/skins/multimedia/spinner.gif +0 -0
- data/html/skins/multimedia/style.css +0 -186
- data/html/skins/standard/index.html.erb +0 -22
- data/html/skins/standard/index.rb +0 -4
- data/html/skins/standard/play.js +0 -18
- data/html/skins/standard/style.css +0 -73
- data/lib/gamefic-sdk/build.rb +0 -30
- data/lib/gamefic-sdk/config.rb +0 -126
- data/lib/gamefic-sdk/debug.rb +0 -4
- data/lib/gamefic-sdk/debug/action.rb +0 -30
- data/lib/gamefic-sdk/debug/plot.rb +0 -23
- data/lib/gamefic-sdk/platform.rb +0 -22
- data/lib/gamefic-sdk/platform/base.rb +0 -68
- data/lib/gamefic-sdk/platform/gfic.rb +0 -27
- data/lib/gamefic-sdk/platform/sinatra.rb +0 -98
- data/lib/gamefic-sdk/platform/web.rb +0 -176
- data/lib/gamefic-sdk/platform/web/app_config.rb +0 -81
- data/lib/gamefic-sdk/platform/web/engine.rb +0 -44
- data/lib/gamefic-sdk/platform/web/user.rb +0 -19
- data/lib/gamefic-sdk/shell/init.rb +0 -83
- data/lib/gamefic-sdk/shell/test.rb +0 -32
- data/scripts/save-restore-undo.plot.rb +0 -25
- data/scripts/snapshots.plot.rb +0 -16
- data/scripts/standard.plot.rb +0 -10
- data/scripts/standard/actions.plot.rb +0 -13
- data/scripts/standard/actions/drop.plot.rb +0 -19
- data/scripts/standard/actions/enter.plot.rb +0 -19
- data/scripts/standard/actions/go.plot.rb +0 -48
- data/scripts/standard/actions/insert.plot.rb +0 -37
- data/scripts/standard/actions/inventory.plot.rb +0 -9
- data/scripts/standard/actions/leave.plot.rb +0 -30
- data/scripts/standard/actions/look.plot.rb +0 -108
- data/scripts/standard/actions/nil.plot.rb +0 -36
- data/scripts/standard/actions/place.plot.rb +0 -41
- data/scripts/standard/actions/quit.plot.rb +0 -11
- data/scripts/standard/actions/take.plot.rb +0 -31
- data/scripts/standard/actions/talk.plot.rb +0 -27
- data/scripts/standard/actions/wait.plot.rb +0 -3
- data/scripts/standard/clothing.plot.rb +0 -4
- data/scripts/standard/clothing/actions.plot.rb +0 -4
- data/scripts/standard/clothing/actions/doff.plot.rb +0 -12
- data/scripts/standard/clothing/actions/drop.plot.rb +0 -8
- data/scripts/standard/clothing/actions/inventory.plot.rb +0 -14
- data/scripts/standard/clothing/actions/wear.plot.rb +0 -20
- data/scripts/standard/clothing/entities.plot.rb +0 -7
- data/scripts/standard/clothing/entities/clothing.plot.rb +0 -5
- data/scripts/standard/clothing/entities/coat.plot.rb +0 -3
- data/scripts/standard/clothing/entities/gloves.plot.rb +0 -3
- data/scripts/standard/clothing/entities/hat.plot.rb +0 -3
- data/scripts/standard/clothing/entities/pants.plot.rb +0 -3
- data/scripts/standard/clothing/entities/shirt.plot.rb +0 -3
- data/scripts/standard/clothing/entities/shoes.plot.rb +0 -3
- data/scripts/standard/container.plot.rb +0 -28
- data/scripts/standard/container/actions.plot.rb +0 -0
- data/scripts/standard/container/entities.plot.rb +0 -5
- data/scripts/standard/direction.plot.rb +0 -55
- data/scripts/standard/edible.plot.rb +0 -21
- data/scripts/standard/entities.plot.rb +0 -12
- data/scripts/standard/entities/character.plot.rb +0 -10
- data/scripts/standard/entities/fixture.plot.rb +0 -3
- data/scripts/standard/entities/item.plot.rb +0 -3
- data/scripts/standard/entities/portal.plot.rb +0 -44
- data/scripts/standard/entities/receptacle.plot.rb +0 -3
- data/scripts/standard/entities/room.plot.rb +0 -57
- data/scripts/standard/entities/rubble.plot.rb +0 -11
- data/scripts/standard/entities/scenery.plot.rb +0 -3
- data/scripts/standard/entities/supporter.plot.rb +0 -7
- data/scripts/standard/entities/thing.plot.rb +0 -7
- data/scripts/standard/give.plot.rb +0 -27
- data/scripts/standard/lockable.plot.rb +0 -79
- data/scripts/standard/modules.plot.rb +0 -9
- data/scripts/standard/modules/attachable.plot.rb +0 -12
- data/scripts/standard/modules/auto_takes.plot.rb +0 -50
- data/scripts/standard/modules/enterable.plot.rb +0 -15
- data/scripts/standard/modules/explicit_exits.plot.rb +0 -15
- data/scripts/standard/modules/itemizable.plot.rb +0 -18
- data/scripts/standard/modules/locale_description.plot.rb +0 -20
- data/scripts/standard/modules/parent-room.plot.rb +0 -9
- data/scripts/standard/modules/portable.plot.rb +0 -11
- data/scripts/standard/modules/use.plot.rb +0 -51
- data/scripts/standard/openable.plot.rb +0 -43
- data/scripts/standard/pathfinder.plot.rb +0 -65
- data/scripts/standard/queries.plot.rb +0 -21
- data/scripts/standard/test.plot.rb +0 -10
- data/scripts/undo.plot.rb +0 -13
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
respond :inventory do |actor|
|
|
2
|
-
if actor.children.length > 0
|
|
3
|
-
actor.tell "#{you.pronoun.Subj} #{you.verb.be} carrying #{actor.children.join_and}."
|
|
4
|
-
else
|
|
5
|
-
actor.tell "#{you.pronoun.Subj} #{you.contract you.verb.be + ' not'} carrying anything."
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
interpret "i", "inventory"
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
respond :leave, Use.parent do |actor, thing|
|
|
2
|
-
actor.tell "There's no way out of #{the thing}."
|
|
3
|
-
end
|
|
4
|
-
|
|
5
|
-
respond :leave, Use.parent(Enterable, :enterable?) do |actor, thing|
|
|
6
|
-
actor.tell "#{you.pronoun.Subj} #{you.verb[thing.leave_verb]} #{the thing}."
|
|
7
|
-
actor.parent = thing.parent
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
respond :leave, Use.room do |actor, room|
|
|
11
|
-
portals = room.children.that_are(Portal)
|
|
12
|
-
if portals.length == 0
|
|
13
|
-
actor.tell "#{you.pronoun.Subj} #{you.contract you.verb.do + ' not'} see any obvious exits."
|
|
14
|
-
elsif portals.length == 1
|
|
15
|
-
actor.perform :go, portals[0]
|
|
16
|
-
else
|
|
17
|
-
actor.tell "I don't know which way you want to go: #{portals.join_or}."
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
respond :leave do |actor|
|
|
22
|
-
actor.perform :leave, actor.parent
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
interpret "exit", "leave"
|
|
26
|
-
interpret "exit :supporter", "leave :supporter"
|
|
27
|
-
interpret "get on :supporter", "enter :supporter"
|
|
28
|
-
interpret "get off :supporter", "leave :supporter"
|
|
29
|
-
interpret "get out :container", "leave :container"
|
|
30
|
-
interpret "get out of :container", "leave :container"
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
respond :look, Use.text do |actor, string|
|
|
2
|
-
if string == 'around'
|
|
3
|
-
actor.perform :look, actor.room
|
|
4
|
-
else
|
|
5
|
-
actor.tell "You don't see any \"#{string}\" here."
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
respond :look, Use.itself do |actor, thing|
|
|
10
|
-
actor.tell actor.description
|
|
11
|
-
actor.perform :inventory
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
respond :look, Use.available do |actor, thing|
|
|
15
|
-
actor.tell thing.description
|
|
16
|
-
thing.children.that_are(:attached?).that_are(:itemized?).each { |item|
|
|
17
|
-
actor.tell "#{An item} is attached to #{the thing}."
|
|
18
|
-
}
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
respond :look, Use.available(Supporter) do |actor, thing|
|
|
22
|
-
actor.proceed
|
|
23
|
-
if thing.accessible?
|
|
24
|
-
itemized = thing.children.that_are_not(:attached?).that_are(:itemized?)
|
|
25
|
-
actor.tell "You see #{itemized.join_and} on #{the thing}." unless itemized.empty?
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
respond :look, Use.available(Receptacle) do |actor, thing|
|
|
30
|
-
actor.proceed
|
|
31
|
-
if thing.accessible?
|
|
32
|
-
itemized = thing.children.that_are_not(:attached?).that_are(:itemized?)
|
|
33
|
-
actor.tell "You see #{itemized.join_and} in #{the thing}." unless itemized.empty?
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
respond :look, Use.parent(Supporter, :enterable?) do |actor, supporter|
|
|
38
|
-
actor.proceed
|
|
39
|
-
actor.tell "#{you.pronoun.Subj} are currently on #{the supporter}."
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
respond :look, Use.room do |actor, room|
|
|
43
|
-
actor.tell "<strong>#{room.name.cap_first}</strong>"
|
|
44
|
-
actor.tell room.description if room.has_description?
|
|
45
|
-
actor.execute :_itemize_room
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
respond :_itemize_room do |actor|
|
|
49
|
-
room = actor.room
|
|
50
|
-
next if room.nil?
|
|
51
|
-
with_locales = []
|
|
52
|
-
chars = room.children.that_are(Character).that_are(:itemized?) - [actor]
|
|
53
|
-
charsum = []
|
|
54
|
-
chars.each { |char|
|
|
55
|
-
if char.locale_description != ""
|
|
56
|
-
with_locales.push char
|
|
57
|
-
else
|
|
58
|
-
charsum.push char
|
|
59
|
-
end
|
|
60
|
-
}
|
|
61
|
-
if charsum.length > 0
|
|
62
|
-
actor.tell "#{charsum.join_and.cap_first} #{charsum.length == 1 ? 'is' : 'are'} here."
|
|
63
|
-
end
|
|
64
|
-
items = room.children.that_are(:itemized?) - [actor] - room.children.that_are(Character) - room.children.that_are(Portal)
|
|
65
|
-
itemsum = []
|
|
66
|
-
items.each { |item|
|
|
67
|
-
if item.locale_description != ""
|
|
68
|
-
with_locales.push item
|
|
69
|
-
else
|
|
70
|
-
itemsum.push item
|
|
71
|
-
end
|
|
72
|
-
}
|
|
73
|
-
if itemsum.length > 0
|
|
74
|
-
actor.tell "#{you.pronoun.Subj} #{you.verb.see} #{itemsum.join_and}."
|
|
75
|
-
end
|
|
76
|
-
with_locales.each { |entity|
|
|
77
|
-
actor.tell entity.locale_description
|
|
78
|
-
}
|
|
79
|
-
if room.explicit_exits?
|
|
80
|
-
portals = room.children.that_are(Portal).that_are(:itemized?)
|
|
81
|
-
if portals.length > 0
|
|
82
|
-
if portals.length == 1
|
|
83
|
-
p = portals[0]
|
|
84
|
-
actor.tell "There is an exit #{p.instruction}."
|
|
85
|
-
else
|
|
86
|
-
dirs = []
|
|
87
|
-
portals.each { |p|
|
|
88
|
-
dirs.push p.instruction
|
|
89
|
-
}
|
|
90
|
-
actor.tell "There are exits #{dirs.join_and(', ')}."
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
if actor.parent.kind_of?(Supporter)
|
|
95
|
-
actor.tell "#{you.pronoun.Subj} #{you.verb.be} on #{the actor.parent}."
|
|
96
|
-
actor.parent.children.that_are_not(actor).each { |s|
|
|
97
|
-
actor.tell "#{A s} is on #{the actor.parent}."
|
|
98
|
-
}
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
interpret "look", "look around"
|
|
103
|
-
interpret "l", "look around"
|
|
104
|
-
|
|
105
|
-
interpret "look at :thing", "look :thing"
|
|
106
|
-
interpret "l :thing", "look :thing"
|
|
107
|
-
interpret "examine :thing", "look :thing"
|
|
108
|
-
interpret "x :thing", "look :thing"
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
meta nil, Query::Text.new() do |actor, string|
|
|
2
|
-
words = string.split_words
|
|
3
|
-
list = verbs
|
|
4
|
-
if list.include?(words[0])
|
|
5
|
-
if words.length > 1
|
|
6
|
-
actor.tell "I recognize '#{words[0]}' as a verb but could not understand the rest of your sentence."
|
|
7
|
-
else
|
|
8
|
-
actor.tell "I recognize '#{words[0]}' as a verb but could not understand it in this context."
|
|
9
|
-
end
|
|
10
|
-
else
|
|
11
|
-
found = []
|
|
12
|
-
list.each { |c|
|
|
13
|
-
next if c.include?('_')
|
|
14
|
-
if c.length > words[0].length and c.start_with?(words[0])
|
|
15
|
-
found.push c
|
|
16
|
-
end
|
|
17
|
-
}
|
|
18
|
-
if found.length == 1
|
|
19
|
-
words[0] = found[0]
|
|
20
|
-
actor.perform words.join(' ')
|
|
21
|
-
elsif found.length > 1 and words[0].length > 2
|
|
22
|
-
actor.tell "I'm not sure if #{words[0]} means #{found.join_and(', ', ' or ')}."
|
|
23
|
-
else
|
|
24
|
-
actor.tell "I don't recognize '#{words[0]}' as a verb."
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
meta nil, Query::Text.new(/^it$/) do |actor, string|
|
|
30
|
-
words = string.split_words
|
|
31
|
-
if verbs(to_s: true).include?(words[0])
|
|
32
|
-
actor.tell "I'm not sure what you mean by \"it.\""
|
|
33
|
-
else
|
|
34
|
-
actor.proceed
|
|
35
|
-
end
|
|
36
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
respond :place, Use.children, Use.reachable do |actor, thing, supporter|
|
|
2
|
-
actor.tell "#{you.pronoun.Subj} #{you.contract(you.verb.can + ' not')} put #{the thing} on #{the supporter}."
|
|
3
|
-
end
|
|
4
|
-
|
|
5
|
-
respond :place, Use.visible, Use.reachable(Supporter) do |actor, thing, supporter|
|
|
6
|
-
if thing.parent != actor
|
|
7
|
-
actor.perform :take, thing
|
|
8
|
-
end
|
|
9
|
-
if thing.parent == actor
|
|
10
|
-
thing.parent = supporter
|
|
11
|
-
actor.tell "You put #{the thing} on #{the supporter}."
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
respond :place, Use.children, Use.reachable(Supporter) do |actor, thing, supporter|
|
|
16
|
-
if thing.sticky?
|
|
17
|
-
actor.tell thing.sticky_message || "#{you.pronoun.Subj} #{you.verb.need} to keep #{the thing} for now."
|
|
18
|
-
else
|
|
19
|
-
thing.parent = supporter
|
|
20
|
-
actor.tell "#{you.pronoun.Subj} #{you.verb.put} #{the thing} on #{the supporter}."
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
respond :place, Use.visible, Use.text do |actor, thing, supporter|
|
|
25
|
-
actor.tell "#{you.pronoun.Subj} #{you.contract(you.verb.do + ' not')} see anything called \"#{supporter}\" here."
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
respond :place, Use.text, Use.visible do |actor, thing, supporter|
|
|
29
|
-
actor.tell "#{you.pronoun.Subj} #{you.contract(you.verb.do + ' not')} see anything called \"#{thing}\" here."
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
respond :place, Use.text, Use.text do |actor, thing, supporter|
|
|
33
|
-
actor.tell "I don't know what you mean by \"#{thing}\" or \"#{supporter}.\""
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
xlate "put :thing on :supporter", "place :thing :supporter"
|
|
37
|
-
xlate "put :thing down on :supporter", "place :thing :supporter"
|
|
38
|
-
xlate "set :thing on :supporter", "place :thing :supporter"
|
|
39
|
-
xlate "set :thing down on :supporter", "place :thing :supporter"
|
|
40
|
-
xlate "drop :thing on :supporter", "place :thing :supporter"
|
|
41
|
-
xlate "place :thing on :supporter", "place :thing :supporter"
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
respond :take, Use.text do |actor, text|
|
|
2
|
-
actor.tell "#{you.pronoun.Subj} #{you.contract(you.verb.do + ' not')} see any \"#{text}\" here."
|
|
3
|
-
end
|
|
4
|
-
|
|
5
|
-
respond :take, Use.available do |actor, thing|
|
|
6
|
-
if thing.parent == actor
|
|
7
|
-
actor.tell "#{you.contract(you.pronoun.subj + ' are').cap_first} already carrying #{the thing}."
|
|
8
|
-
elsif thing.portable?
|
|
9
|
-
if actor.parent != thing.parent
|
|
10
|
-
actor.tell "#{you.pronoun.Subj} #{you.verb.take} #{the thing} from #{the thing.parent}."
|
|
11
|
-
else
|
|
12
|
-
actor.tell "#{you.pronoun.Subj} #{you.verb.take} #{the thing}."
|
|
13
|
-
end
|
|
14
|
-
thing.parent = actor
|
|
15
|
-
else
|
|
16
|
-
actor.tell "#{you.pronoun.Subj} #{you.contract you.verb.can + ' not'} take #{the thing}."
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
respond :take, Use.available(:attached?) do |actor, thing|
|
|
21
|
-
actor.tell "#{The thing} is attached to #{the thing.parent}."
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
respond :take, Use.available(Rubble) do |actor, rubble|
|
|
25
|
-
actor.tell "#{you.pronoun.Subj} #{you.contract(you.verb.do + ' not')} have any use for #{the rubble}."
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
interpret "get :thing", "take :thing"
|
|
29
|
-
interpret "pick up :thing", "take :thing"
|
|
30
|
-
interpret "pick :thing up", "take :thing"
|
|
31
|
-
interpret "carry :thing", "take :thing"
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
respond :talk do |actor|
|
|
2
|
-
actor.tell "#{you.pronoun.Subj} #{you.verb.talk} to #{you.pronoun.reflex}."
|
|
3
|
-
end
|
|
4
|
-
|
|
5
|
-
respond :talk, Use.itself do |actor, yourself|
|
|
6
|
-
actor.perform :talk
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
respond :talk, Use.available do |actor, thing|
|
|
10
|
-
actor.tell "Nothing happens."
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
respond :talk, Use.available(Character) do |actor, character|
|
|
14
|
-
if actor == character
|
|
15
|
-
actor.perform :talk
|
|
16
|
-
else
|
|
17
|
-
actor.tell "#{The character} has nothing to say."
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
interpret "talk to :character", "talk :character"
|
|
22
|
-
interpret "talk to :character about :subject", "talk :character :subject"
|
|
23
|
-
interpret "ask :character :subject", "talk :character :subject"
|
|
24
|
-
interpret "ask :character about :subject", "talk :character :subject"
|
|
25
|
-
interpret "tell :character :subject", "talk :character :subject"
|
|
26
|
-
interpret "tell :character about :subject", "talk :character :subject"
|
|
27
|
-
interpret "ask :character for :subject", "talk :character :subject"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
respond :doff, Query::Children.new(Clothing) do |actor, clothing|
|
|
2
|
-
if !clothing.attached?
|
|
3
|
-
actor.tell "You're not wearing #{the clothing}."
|
|
4
|
-
else
|
|
5
|
-
clothing.attached = false
|
|
6
|
-
actor.tell "You take off #{the clothing}."
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
xlate "remove :clothing", "doff :clothing"
|
|
11
|
-
xlate "take off :clothing", "doff :clothing"
|
|
12
|
-
xlate "take :clothing off", "doff :clothing"
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
respond :inventory do |actor|
|
|
2
|
-
if actor.children.length > 0
|
|
3
|
-
carried = actor.children.that_are_not(:attached?)
|
|
4
|
-
worn = actor.children.that_are(:attached?)
|
|
5
|
-
if carried.length > 0
|
|
6
|
-
actor.tell "You are carrying #{carried.join_and}."
|
|
7
|
-
end
|
|
8
|
-
if worn.length > 0
|
|
9
|
-
actor.tell "You are wearing #{worn.join_and}."
|
|
10
|
-
end
|
|
11
|
-
else
|
|
12
|
-
actor.tell "You aren't carrying anything."
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
respond :wear, Use.available(Clothing) do |actor, clothing|
|
|
2
|
-
if clothing.parent != actor
|
|
3
|
-
actor.tell "You don't have #{the clothing}."
|
|
4
|
-
end
|
|
5
|
-
if clothing.attached?
|
|
6
|
-
actor.tell "You're already wearing #{the clothing}."
|
|
7
|
-
else
|
|
8
|
-
already = actor.children.that_are(clothing.class).that_are(:attached?)
|
|
9
|
-
if already.length == 0
|
|
10
|
-
clothing.attached = true
|
|
11
|
-
actor.tell "You put on #{the clothing}."
|
|
12
|
-
else
|
|
13
|
-
actor.tell "You're already wearing #{an already[0]}."
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
xlate "put on :clothing", "wear :clothing"
|
|
19
|
-
xlate "put :clothing on", "wear :clothing"
|
|
20
|
-
xlate "don :clothing", "wear :clothing"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
script 'standard/clothing/entities/clothing'
|
|
2
|
-
script 'standard/clothing/entities/coat'
|
|
3
|
-
script 'standard/clothing/entities/gloves'
|
|
4
|
-
script 'standard/clothing/entities/hat'
|
|
5
|
-
script 'standard/clothing/entities/pants'
|
|
6
|
-
script 'standard/clothing/entities/shirt'
|
|
7
|
-
script 'standard/clothing/entities/shoes'
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# @gamefic.script standard/container
|
|
2
|
-
|
|
3
|
-
script 'standard/openable'
|
|
4
|
-
script 'standard/lockable'
|
|
5
|
-
#script 'standard/container/entities'
|
|
6
|
-
#script 'standard/container/actions'
|
|
7
|
-
|
|
8
|
-
class Container < Receptacle
|
|
9
|
-
include Openable
|
|
10
|
-
include Lockable
|
|
11
|
-
#include Transparent
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
respond :insert, Use.available, Use.available(Container) do |actor, thing, container|
|
|
15
|
-
if container.open?
|
|
16
|
-
actor.proceed
|
|
17
|
-
else
|
|
18
|
-
actor.tell "#{The container} is closed."
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
respond :leave, Use.parent(Container, :enterable?, :closed?) do |actor, container|
|
|
23
|
-
actor.tell "#{The container} is closed."
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
respond :enter, Use.siblings(Container, :enterable?, :closed?) do |actor, container|
|
|
27
|
-
actor.tell "#{The container} is closed."
|
|
28
|
-
end
|