summaryrefslogtreecommitdiffstats
path: root/nfsw/scenes.py
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-10-19 17:57:05 -0400
committerrsiddharth <s@ricketyspace.net>2019-10-19 17:57:05 -0400
commit72885e96e5afaaf990fbce621247fae0158d152e (patch)
treeb6bd315d36ceb8774ec8e1a346a8e7babfb40ec8 /nfsw/scenes.py
parentc2ee54a832a87a14624a4b1e1e0a85782285b7e1 (diff)
nfsw/scenes.py: Updtae xkcd.
* nfsw/scenes.py (xkcd): Flush it out.
Diffstat (limited to 'nfsw/scenes.py')
-rw-r--r--nfsw/scenes.py58
1 files changed, 57 insertions, 1 deletions
diff --git a/nfsw/scenes.py b/nfsw/scenes.py
index 604e58a..2c76ad4 100644
--- a/nfsw/scenes.py
+++ b/nfsw/scenes.py
@@ -481,7 +481,63 @@ def strayed(o):
def xkcd(o):
- return 'XKCD Sky'
+ r = redis()
+
+ gobbledygook = [
+ 'A flock of warblers cruise through'
+ '\nthe wondrous blue white atmosphere'
+ '\nand dwindle out of view to their'
+ '\nwinter recluse',
+ 'You know.'
+ '\nRandall Munroe likes oglaf!',
+ 'It\'s dusk now.'
+ '\nThe space around you is'
+ '\norange with tinges of blue.'
+ ]
+
+ def rj(name):
+ return read_junk('xkcd/{}'.format(name))
+
+
+ def gg():
+ l = len(gobbledygook)
+
+ for i in range(0, l):
+ if r.sismember('scene:xkcd:gg', i):
+ continue
+
+ r.sadd('scene:xkcd:gg', i)
+ return gobbledygook[i]
+
+ return 'The space\'s outta words.'
+
+
+ def p_done():
+ # Mark scene done
+ r.sadd('scenes:done', 'xkcd')
+
+ # Move to next scene
+ r.set('scene', 'bedroom')
+
+ return '\n\n'.join([
+ rj('pass-out'),
+ bedroom({'intro': 1})
+ ])
+
+
+ def p(q):
+
+ if 'people are complicated' in q:
+ return p_done()
+
+ return gg()
+
+
+ if 'intro' in o:
+ return rj('intro')
+
+ if 'q' in o:
+ return p(o['q'])
def bedroom(o):