gamefic 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gamefic.rb +1 -0
- data/lib/gamefic/character.rb +19 -13
- data/lib/gamefic/engine.rb +2 -103
- data/lib/gamefic/engine/base.rb +55 -0
- data/lib/gamefic/engine/tty.rb +20 -254
- data/lib/gamefic/html.rb +20 -19
- data/lib/gamefic/html_to_ansi.rb +185 -0
- data/lib/gamefic/plot.rb +21 -29
- data/lib/gamefic/plot/scene_mount.rb +103 -36
- data/lib/gamefic/scene.rb +3 -2
- data/lib/gamefic/scene/active.rb +1 -6
- data/lib/gamefic/scene/base.rb +34 -8
- data/lib/gamefic/scene/conclusion.rb +0 -3
- data/lib/gamefic/scene/custom.rb +28 -7
- data/lib/gamefic/scene/multiple_choice.rb +31 -38
- data/lib/gamefic/scene/multiple_scene.rb +15 -0
- data/lib/gamefic/scene/pause.rb +4 -15
- data/lib/gamefic/scene/yes_or_no.rb +8 -13
- data/lib/gamefic/scene_data.rb +9 -0
- data/lib/gamefic/scene_data/base.rb +12 -0
- data/lib/gamefic/scene_data/multiple_choice.rb +19 -0
- data/lib/gamefic/scene_data/multiple_scene.rb +25 -0
- data/lib/gamefic/scene_data/yes_or_no.rb +18 -0
- data/lib/gamefic/shell.rb +77 -78
- data/lib/gamefic/tester.rb +1 -1
- data/lib/gamefic/tty.rb +8 -0
- data/lib/gamefic/user.rb +8 -0
- data/lib/gamefic/user/base.rb +21 -0
- data/lib/gamefic/user/buffer.rb +25 -0
- data/lib/gamefic/user/tty.rb +55 -0
- data/lib/gamefic/version.rb +1 -1
- metadata +15 -6
- data/lib/gamefic/engine/cgi.rb +0 -221
- data/lib/gamefic/scene/multiple_choice/input.rb +0 -11
- data/lib/gamefic/scene/passive.rb +0 -17
- data/lib/gamefic/scene/question.rb +0 -21
@@ -1,21 +0,0 @@
|
|
1
|
-
module Gamefic
|
2
|
-
|
3
|
-
# Question Scenes handle a string of arbitrary input. Examples include
|
4
|
-
# asking for a password, a destination, or a topic of conversation. The
|
5
|
-
# finish block is solely responsible for processing the answer.
|
6
|
-
# After the scene is finished, the :active scene will automatically be cued
|
7
|
-
# if no other scene has been cued or prepared.
|
8
|
-
#
|
9
|
-
class Scene::Question < Scene::Custom
|
10
|
-
def initialize prompt, &block
|
11
|
-
@prompt = prompt
|
12
|
-
@finish = block
|
13
|
-
end
|
14
|
-
def finish actor, input
|
15
|
-
this_scene = actor.scene
|
16
|
-
super
|
17
|
-
actor.cue :active if (actor.scene == this_scene and actor.next_scene.nil?)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|