def _compile_MUSIC(self, music): self.add_paragraph(style='Actor Instruction') song = music['target'][1] if scp.typed_check(music['target'], 'string'): dot = song.rfind('.') song = song[0:dot] line = 'We hear ' if music['action'] == 'start': if music['fadeout'] is not None: line += 'the current music fade out' + scp.get_duration_words(music['fadeout'], 'over %d seconds') + ', ' line += 'and then we hear ' line += 'the song ' self.add_run(line) self.add_run(scp.to_words(song).title(), italic=False) self.add_run(' begin to play.') elif music['action'] == 'stop': if scp.typed_check(music['target'], 'rel'): line += song.lower() + ' music ' else: line += 'the song ' self.add_run(line) self.add_run(scp.to_words(song).title(), italic=False) line = ' ' if music['duration'] is not None: line += 'fade out' + scp.get_duration_words(music['duration'], 'over %d seconds') + '.' else: line += 'stop.' self.add_run(line)
def _compile_CAMERA(self, camera): line = 'We' acts_added = 0 for act in camera['actions']: if acts_added == len(camera['actions']) - 1 and len(camera['actions']) > 1: line += ' and then' if 'duration' in act and scp.typed_check(act['duration'], 'rel'): line += scp.get_duration_words(act['duration'], '') if act['type'] == 'SNAP': line += ' focus on the ' + scp.to_words(act['target'][1]) elif act['type'] == 'PAN': line += ' shift our focus to the ' + scp.to_words(act['target'][1]) elif act['type'] == 'ZOOM': line += ' move ' if scp.typed_check(act['target'], 'rel', 'IN'): line += 'in closer' elif scp.typed_check(act['target'], 'rel', 'OUT'): line += 'back farther' if 'duration' in act and not scp.typed_check(act['duration'], 'rel'): line += scp.get_duration_words(act['duration'], 'over %d seconds') if acts_added < len(camera['actions']) - 1 and len(camera['actions']) > 2: line += ',' acts_added += 1 line += '.' self.add_paragraph(line, style='Actor Instruction')
def _compile_EXIT(self, exit): geom = exit['motion'] dest = None origin = None if geom is not None: if geom['destination'] is not None: dest = geom['destination'][1] if geom['origin'] is not None: origin = geom['origin'][1] line = scp.to_words(exit['target'][1]).title() + ' ' if geom is not None: line += 'moves ' if origin is not None: line += 'from the ' + scp.to_words(origin).lower() + ' ' if dest is not None: line += 'to the ' + scp.to_words(dest).lower() + ' ' if geom is not None: line += 'and ' if exit['transition'] is not None: line += scp.to_words(exit['transition'][1]).lower() + 's out of ' else: line += 'exits ' line += 'the scene' if geom is not None: line += scp.get_duration_words(geom['duration'], 'over %d seconds') line += '.' self.add_paragraph(line, style='Actor Instruction')
def _compile_ENTER(self, enter): geom = enter['motion'] dest = None origin = None if geom is not None: if geom['destination'] is not None: dest = geom['destination'][1] if geom['origin'] is not None: origin = geom['origin'][1] line = scp.to_words(enter['target'][1]).title() if len(enter['states']) > 0: line += ',' line += make_states(enter['states']) line += ', ' else: line += ' ' if enter['transition'] is not None: line += scp.to_words(enter['transition'][1]).lower() + 's in to ' else: line += 'enters ' line += 'the scene' if origin is not None: line += ' near the ' + scp.to_words(origin).lower() if dest is not None: line += ' and moves to the ' + scp.to_words(dest).lower() if geom is not None: line += scp.get_duration_words(geom['duration'], 'over %d seconds') line += '.' self.add_paragraph(line, style='Actor Instruction')
def _compile_ACTION(self, action): line = scp.to_words(action['target'][1]).title() + ' ' if len(action['states']) > 0: line += 'changes to appear' line += make_states(action['states']) if action['destination'] is not None: line += ', and then ' if action['destination'] is not None: line += 'moves to the ' + scp.to_words(action['destination'][1]).lower() line += scp.get_duration_words(action['duration'], 'over %d seconds') line += '.' self.add_paragraph(line, style='Actor Instruction')
def _compile_GFX(self, gfx): line = 'We see ' if gfx['action'] == 'start': a = scp.indef_article(gfx['target'][1]) line += a + ' ' + scp.to_words(gfx['target'][1]).upper() if scp.typed_check(gfx['loop'], 'boolean', True): line += ' effect begin and continue' line += '.' elif gfx['action'] == 'stop': if scp.typed_check(gfx['target'], 'rel'): line += gfx['target'][1].lower() + ' effects ' else: line += 'the ' + scp.to_words(gfx['target'][1]).upper() + ' effect ' if gfx['duration'] is not None: line += 'fade away' + scp.get_duration_words(gfx['duration'], 'over %d seconds') + '.' else: line += 'stop.' self.add_paragraph(line, style='Actor Instruction')
def _compile_SFX(self, sfx): fx = sfx['target'][1] if scp.typed_check(sfx['target'], 'string'): dot = fx.rfind('.') fx = fx[0:dot] line = 'We hear ' if sfx['action'] == 'start': a = scp.indef_article(fx) line += a + ' ' + scp.to_words(fx).upper() if scp.typed_check(sfx['loop'], 'boolean', True): line += ' sound begin to repeat' line += '.' elif sfx['action'] == 'stop': if scp.typed_check(sfx['target'], 'rel'): line += fx.lower() + ' repeating sounds ' else: line += 'the repeated ' + scp.to_words(fx).upper() + ' sound ' if sfx['duration'] is not None: line += 'fade away' + scp.get_duration_words(sfx['duration'], 'over %d seconds') + '.' else: line += 'stop.' self.add_paragraph(line, style='Actor Instruction')