From 72885e96e5afaaf990fbce621247fae0158d152e Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 19 Oct 2019 17:57:05 -0400 Subject: nfsw/scenes.py: Updtae xkcd. * nfsw/scenes.py (xkcd): Flush it out. --- nfsw/scenes.py | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3