def werewolf_anchors(caller, raw_string, **kwargs): caller.db.cg['start_node'] = 'werewolf_anchors' caller.db.cg['raw_string'] = strip_control_sequences(raw_string) caller.db.cg['kwargs'] = kwargs blood = get(caller,'Blood',statclass='Sphere') bone = get(caller,'Bone',statclass='Sphere') text = 'Blood: ' if blood: text = text + blood + '|/' else: text = text + 'Unset|/' text = text + 'Bone: ' if bone: text = text + bone + '|/' else: text = text + 'Unset|/' text = text + '|/Chose what to work on' option_list = [ { 'desc' : 'Blood', 'goto' : ('choose_anchor', { 'type' : 'blood' } ) }, { 'desc' : 'Bone', 'goto' : ('choose_anchor', { 'type' : 'bone' } ) } ] if blood and bone: option_list.append ( { 'key' : 'P', 'desc' : 'Proceed', 'goto' : _starting_gifts } ) option_list.append({'desc': 'Back', 'key': 'B', 'goto': _return_to_renown}) option_list.append({'desc': 'Back', 'key': 'back', 'goto': _return_to_renown}) option_list.append({'key': 'q', 'desc': 'Quit', 'goto': 'quit_menu'}) option_list.append({'key': 'Quit', 'desc': 'Quit', 'goto': 'quit_menu'}) options = tuple(option_list) footer = '|/(Additional options include |w\'help\'|n and |w\'quit\'|n)' help = ('|/' + '_' * 79 + '|/|/' + 'Your character possesses traits called Blood and Bone. They ' + 'reflect a core dichotomy of the Uratha condition. A Blood ' + 'archetype reflects your character\'s behavior and identity on ' + 'the hunt, when claws are out, and lives are on the line. A Bone ' + 'archetype reflects your character\'s sense of self-identity. ' + 'It\'s who she is behind the instincts, fur, and fury.' + '|/' + '_' * 79) options_format = {'hide_keys': ['q', 'Quit', 'back'], 'move_keys': ['B', 'P'], 'rows': 10} display = {'text': text, 'help': help, 'options_format': options_format, 'footer': footer} return display, options
def get(self, entry, subentry='', statclass=''): try: result = get(self, entry, subentry=subentry, statclass=statclass) except: return -1 else: return result
def vampire_merits(caller, raw_string, **kwargs): caller.db.cg['start_node'] = 'vampire_merits' caller.db.cg['raw_string'] = strip_control_sequences(raw_string) caller.db.cg['kwargs'] = kwargs max = 10 total = 0 text = 'Blood Potency: ' + str(caller.db.power['Blood Potency']) + \ '|/Merits:|/|/' for item in caller.db.merits: out = item[0] total = total + item[1] if len(item[2]) > 0: out = out + ' (' + item[2] + ')' out = out + ': ' + str(item[1]) text = text + out + '|/' total = total + (caller.get('Blood Potency', statclass='Power') - 1) * 5 text = text + '|/Points remaining: ' + str(max - total) option_list = [] if total < max: option_list.append({ 'key': 'A', 'desc': 'Add a merit', 'goto': ('add_merit', { 'total': total, 'max': max }) }) if max - total > 4: option_list.append({ 'key': 'I', 'desc': 'Increase Blood Potency', 'goto': _increase_power }) if get(caller, 'Blood Potency', statclass='Power') > 1: option_list.append({ 'key': 'D', 'desc': 'Decrease Blood Potency', 'goto': _decrease_power }) if total > 0: option_list.append({ 'key': 'R', 'desc': 'Remove a merit', 'goto': ('remove_merit', { 'total': total, 'max': max }) }) if total == max: option_list.append({ 'key': 'P', 'desc': 'Proceed', 'goto': 'vampire_disciplines' }) option_list.append({ 'desc': 'Back', 'key': 'B', 'goto': _return_to_anchors }) option_list.append({ 'desc': 'Back', 'key': 'back', 'goto': _return_to_anchors }) option_list.append({'key': 'q', 'desc': 'Quit', 'goto': 'quit_menu'}) option_list.append({'key': 'Quit', 'desc': 'Quit', 'goto': 'quit_menu'}) options = tuple(option_list) footer = '|/(Additional options include |w\'help\'|n and |w\'quit\'|n)' help = ('|/' + '_' * 79 + '|/|/' + 'Merits are important facets of your character that do not fall ' + 'under other traits. A Merit can represent a knack, special ' + 'training, people your character knows, or even things that he ' + 'owns. They add unique capabilities to your character beyond ' + 'Attributes and Skills.' + '|/' + '_' * 79) options_format = { 'hide_keys': ['q', 'Quit', 'back'], 'move_keys': ['B', 'P'], 'rows': 10 } display = { 'text': text, 'help': help, 'options_format': options_format, 'footer': footer } return display, options
def vampire_anchors(caller, raw_string, **kwargs): caller.db.cg['start_node'] = 'vampire_anchors' caller.db.cg['raw_string'] = strip_control_sequences(raw_string) caller.db.cg['kwargs'] = kwargs mask = get(caller, 'Mask', statclass='Sphere') dirge = get(caller, 'Dirge', statclass='Sphere') text = 'Mask: ' if mask: text = text + mask + '|/' else: text = text + 'Unset|/' text = text + 'Dirge: ' if dirge: text = text + dirge + '|/' else: text = text + 'Unset|/' text = text + '|/Chose what to work on' option_list = [{ 'desc': 'Mask', 'goto': ('choose_anchor', { 'type': 'mask' }) }, { 'desc': 'Dirge', 'goto': ('choose_anchor', { 'type': 'dirge' }) }] if mask and dirge: option_list.append({ 'key': 'P', 'desc': 'Proceed', 'goto': 'vampire_merits' }) option_list.append({ 'desc': 'Back', 'key': 'B', 'goto': 'vampire_covenant' }) option_list.append({ 'desc': 'Back', 'key': 'back', 'goto': 'vampire_covenant' }) option_list.append({'key': 'q', 'desc': 'Quit', 'goto': 'quit_menu'}) option_list.append({'key': 'Quit', 'desc': 'Quit', 'goto': 'quit_menu'}) options = tuple(option_list) footer = '|/(Additional options include |w\'help\'|n and |w\'quit\'|n)' help = ( '|/' + '_' * 79 + '|/|/' + 'Choose a Mask and a Dirge for your character. Whereas a mortal ' + 'character has a Virtue and a Vice, Kindred characters have ' + 'Masks and Dirges.|/|/Kindred wear Masks in public. A Mask is ' + 'the persona she shows the prey. The Mask is the pretty lie, the ' + 'identity that keeps her walking among the flock as an insider, ' + 'even though she\'s nothing of the sort. It reflects how she ' + 'deals with human society.|/|/The Dirge is who she is behind ' + 'closed doors, and when dealing with other Kindred. A Dirge is ' + 'the harsh truth to which she clings. It\'s the grounding point ' + 'to which she always returns. When she walks the halls of ' + 'Elysium, and works within her covenant, she presents her Dirge.' + '|/' + '_' * 79) options_format = { 'hide_keys': ['q', 'Quit', 'back'], 'move_keys': ['B', 'P'], 'rows': 10 } display = { 'text': text, 'help': help, 'options_format': options_format, 'footer': footer } return display, options
def prove_func(target, prove_input): if prove_input: parsed = parser(prove_input) else: parsed = {'args': '', 'entry': '', 'subentry': '', 'statclass': '', 'value': 0} if len(parsed['entry'].split(':')) == 2: value = data.get(target, parsed['entry']) if value == 1: message = (target.name + ' possesses the specialty ' + parsed['entry']) send_message(target, message) else: target.msg('I can\'t do that') elif parsed['statclass'].lower() == 'rote': if target.get(parsed['entry'], statclass='Rote'): message = (target.name + ' possesses the rote ' + data.find(parsed['entry'], statclass='Spell')[0].db.longname) send_message(target, message) else: target.msg('I can\'t do that.') elif parsed['statclass'].lower() == 'praxis': if target.get(parsed['entry'], statclass='Praxis'): message = (target.name + ' possesses the praxis ' + data.find(parsed['entry'], statclass='Spell')[0].db.longname) send_message(target, message) else: target.msg('I can\'t do that.') elif parsed['entry'] != '': stats = data.find(parsed['entry'], statclass=parsed['statclass']) if len(stats) == 0: target.msg('Nothing found') elif 5 > len(stats) > 1: message = short_list(stats) target.msg(message) elif len(stats) > 4: target.msg('Too many found') else: stat = stats[0] value = stat.get(target, subentry=parsed['subentry']) name = stat.db.longname if parsed['subentry'] != '': name = name + '(' + parsed['subentry'] + ')' if str(value) == 'True': message = (target.name + ' possesses the ' + stat.type() + ' of ' + name) send_message(target, message) elif (parsed['value'] != '' and value >= parsed['value'] and value != 0): message = (target.name + ' possesses at least ' + name + ': ' + str(parsed['value'])) send_message(target, message) elif value != 0: message = target.name + ' possesses ' if not isinstance(value, int): message = message + 'the ' + name + ' of ' + str(value) else: message = message + name + ': ' + str(value) send_message(target, message) else: target.msg('I can\'t do that.') else: target.msg('No entry')
def mortal_template(caller, raw_string, **kwargs): caller.db.cg['start_menu'] = 'cg_mortal' caller.db.cg['start_node'] = 'mortal_template' caller.db.cg['raw_string'] = strip_control_sequences(raw_string) caller.db.cg['kwargs'] = kwargs caller.db.basics = {'Sphere': 'Mortals'} caller.db.power = {} virtue = get(caller, 'Virtue', statclass='Sphere') vice = get(caller, 'Vice', statclass='Sphere') text = 'Virtue: ' if virtue: text = text + virtue + '|/' else: text = text + 'Unset|/' text = text + 'Vice: ' if vice: text = text + vice + '|/' else: text = text + 'Unset|/' text = text + '|/Chose what to work on' option_list = [{ 'desc': 'Virtue', 'goto': ('choose_anchor', { 'type': 'virtue' }) }, { 'desc': 'Vice', 'goto': ('choose_anchor', { 'type': 'vice' }) }] if virtue and vice: option_list.append({ 'key': 'P', 'desc': 'Proceed', 'goto': 'mortal_merits' }) option_list.append({ 'desc': 'Back', 'key': 'B', 'goto': 'return_to_main_cg' }) option_list.append({ 'desc': 'Back', 'key': 'back', 'goto': 'return_to_main_cg' }) option_list.append({'key': 'q', 'desc': 'Quit', 'goto': 'quit_menu'}) option_list.append({'key': 'Quit', 'desc': 'Quit', 'goto': 'quit_menu'}) options = tuple(option_list) footer = '|/(Additional options include |w\'help\'|n and |w\'quit\'|n)' helptext = ('All Chronicles of Darkness characters have defining ' 'personality traits. These traits not only tell a character ' 'who she is, but also allow her to regain Willpower (for more ' 'information on spending and regaining Willpower, see Chapter ' '2). These traits are called Anchors. For a mortal character, ' 'these Anchors are her Virtue and her Vice.') display = { 'text': { 'contents': text }, 'help': { 'formatter': 'bars', 'contents': helptext }, 'options': { 'contents': options, 'hidekeys': ['q', 'Quit', 'back'], 'movekeys': ['B', 'P'], 'rows': 10 }, 'footer': { 'contents': footer } } return display
def changeling_merits(caller, raw_string, **kwargs): caller.db.cg['start_node'] = 'changeling_merits' caller.db.cg['raw_string'] = strip_control_sequences(raw_string) caller.db.cg['kwargs'] = kwargs if caller.db.sphere['Court'] != 'None': max = 11 else: max = 10 total = 0 text = 'Wyrd: ' + str(caller.db.power['Wyrd']) + '|/Merits:|/|/' for item in caller.db.merits: out = item[0] total = total + item[1] if len(item[2]) > 0: out = out + ' (' + item[2] + ')' out = out + ': ' + str(item[1]) text = text + out + '|/' total = total + (caller.get('Wyrd', statclass='Power') - 1) * 5 text = text + '|/Points remaining: ' + str(max - total) option_list = [] if total < max: option_list.append({ 'key': 'A', 'desc': 'Add a merit', 'goto': ('add_merit', { 'total': total, 'max': max }) }) if max - total > 4: option_list.append({ 'key': 'I', 'desc': 'Increase Wyrd', 'goto': _increase_power }) if get(caller, 'Wyrd', statclass='Power') > 1: option_list.append({ 'key': 'D', 'desc': 'Decrease Wyrd', 'goto': _decrease_power }) if total > 0: option_list.append({ 'key': 'R', 'desc': 'Remove a merit', 'goto': ('remove_merit', { 'total': total, 'max': max }) }) if total == max: option_list.append({ 'key': 'P', 'desc': 'Proceed', 'goto': 'changeling_contracts' }) option_list.append({ 'desc': 'Back', 'key': 'B', 'goto': _return_to_regalia }) option_list.append({ 'desc': 'Back', 'key': 'back', 'goto': _return_to_regalia }) option_list.append({'key': 'q', 'desc': 'Quit', 'goto': 'quit_menu'}) option_list.append({'key': 'Quit', 'desc': 'Quit', 'goto': 'quit_menu'}) options = tuple(option_list) footer = '|/(Additional options include |w\'help\'|n and |w\'quit\'|n)' helptext = ('Merits are important facets of your character that do not ' 'fall under other traits. A Merit can represent a knack, ' 'special training, people your character knows, or even ' 'things that he owns. They add unique capabilities to your ' 'character beyond Attributes and Skills.') display = { 'text': { 'contents': text }, 'help': { 'contents': helptext, 'formatter': 'bars' }, 'options': { 'contents': options, 'hidekeys': ['q', 'Quit', 'back'], 'movekeys': ['B', 'P'], 'rows': 4 }, 'footer': { 'contents': footer } } return display
def changeling_anchors(caller, raw_string, **kwargs): caller.db.cg['start_node'] = 'changeling_anchors' caller.db.cg['raw_string'] = strip_control_sequences(raw_string) caller.db.cg['kwargs'] = kwargs needle = get(caller, 'Needle', statclass='Sphere') thread = get(caller, 'Thread', statclass='Sphere') text = 'Needle: ' if needle: text = text + needle + '|/' else: text = text + 'Unset|/' text = text + 'Thread: ' if thread: text = text + thread + '|/' else: text = text + 'Unset|/' text = text + '|/Chose what to work on' option_list = [{ 'desc': 'Needle', 'goto': ('choose_anchor', { 'type': 'needle' }) }, { 'desc': 'Thread', 'goto': ('choose_anchor', { 'type': 'thread' }) }] if needle and thread: option_list.append({ 'key': 'P', 'desc': 'Proceed', 'goto': 'changeling_regalia' }) option_list.append({'desc': 'Back', 'key': 'B', 'goto': _return_to_court}) option_list.append({ 'desc': 'Back', 'key': 'back', 'goto': _return_to_court }) option_list.append({'key': 'q', 'desc': 'Quit', 'goto': 'quit_menu'}) option_list.append({'key': 'Quit', 'desc': 'Quit', 'goto': 'quit_menu'}) options = tuple(option_list) footer = '|/(Additional options include |w\'help\'|n and |w\'quit\'|n)' helptext = ('Changelings approach problems and deal with challenges and ' 'people as defined by their Needle. Needle is the ' 'changeling\'s true self that she uses as a shield against ' 'becoming someone she is not. People see her Needle, they ' 'interact with her based on it, and it informs her actions.|/' '|/' 'Thread is the motivation that keeps a changeling strong. ' 'This is the tie that binds her to reality. Thread combines ' 'her innermost fears, desires, and needs that drive her ' 'forward and keep her grounded. When everything goes wrong, ' 'and she\'s only just hanging on, Thread is what reminds a ' 'changeling how she overcame the vulnerability Arcadia forced ' 'upon her.') display = { 'text': { 'contents': text }, 'help': { 'contents': helptext, 'formatter': 'bars' }, 'options': { 'contents': options, 'hidekeys': ['q', 'Quit', 'back'], 'movekeys': ['B', 'P'], 'rows': 4 }, 'footer': { 'contents': footer } } return display
def werewolf_merits(caller, raw_string, **kwargs): caller.db.cg['start_node'] = 'werewolf_merits' caller.db.cg['raw_string'] = strip_control_sequences(raw_string) caller.db.cg['kwargs'] = kwargs max = 12 total = 0 rites_list = [] rites_points = 0 for item in list(caller.db.werewolfRites.keys()): rites_list.append(item) rite = find(item,statclass='werewolf rite')[0] rites_points = rites_points + rite.db.rank if len(rites_list) > 0: rites_list.sort() text = 'Primal Urge: ' + str(caller.db.power['Primal Urge']) + \ '|/|/|_|_Rites:|/' for item in rites_list: text = text + '|_|_|_|_' + item + '|/' text = text + '|/|_|_Merits:|/' for item in caller.db.merits: out = item[0] total = total + item[1] if len(item[2]) > 0: out = out + ' (' + item[2] + ')' out = out + ': ' + str(item[1]) text = text + '|_|_|_|_' + out + '|/' total = total + (caller.get('Primal Urge',statclass='Power') - 1) * 5 if rites_points > 2: total = total + rites_points - 2 text = text + '|/Points remaining: ' + str(max - total) option_list = [] if total < max: option_list.append( {'desc' : 'Add a merit', 'goto' : ( 'add_merit', { 'total' : total, 'max' : max} ) } ) if total < max and rites_points < 7: option_list.append({'desc': 'Add a rite', 'goto': ('add_rite', {'total': total, 'rites_points': rites_points, 'max': max})}) if max - total > 4: option_list.append ( {'desc' : 'Increase Primal Urge', 'goto' : _increase_power } ) if get(caller,'Primal Urge',statclass='Power') > 1: option_list.append ( {'desc' : 'Decrease Primal Urge', 'goto' : _decrease_power } ) if len(caller.db.merits) > 2: option_list.append( {'desc' : 'Remove a merit', 'goto' : ('remove_merit', {'total' : total, 'max' : max} ) } ) if rites_points > 0: option_list.append({'desc': 'Remove a rite', 'goto': ('remove_rite', {'total': total, 'max': max})}) if total == max and rites_points >= 2: option_list.append( {'key' : 'F', 'desc' : 'Finish', 'goto' : 'werewolf_finish_cg'}) option_list.append({'desc': 'Back', 'key': 'B', 'goto': _return_to_gifts}) option_list.append({'desc': 'Back', 'key': 'back', 'goto': _return_to_gifts}) option_list.append({'key': 'q', 'desc': 'Quit', 'goto': 'quit_menu'}) option_list.append({'key': 'Quit', 'desc': 'Quit', 'goto': 'quit_menu'}) options = tuple(option_list) footer = '|/(Additional options include |w\'help\'|n and |w\'quit\'|n)' help = ('|/' + '_' * 79 + '|/|/' + 'Your character receives ten dots of Merits. You can choose from ' + 'any of the Forsaken Merits or the general Merits. Use these ' + 'Merits to flesh out your character\'s relationship to the world ' + 'around her. They reflect her friends, allies, holdings, and ' + 'experiences. They let you add a custom touch on top of all the ' + 'abstract numbers.|/|/You can also use starting Merit dots to ' + 'raise Primal Urge. If you choose to do so, each Primal Urge dot ' + 'costs five Merit dots. Starting at Primal Urge 2 costs five ' + 'dots, starting at Primal Urge 3 costs ten dots.|/|/You can ' + 'trade up to five of your starting Merit dots for extra dots of ' + 'rites. One dot of rites costs one Merit dot. If you want a ' + 'three-dot rite, you can get it by spending three Merit dots.' + '|/' + '_' * 79) options_format = {'hide_keys': ['q', 'Quit', 'back'], 'move_keys': ['B', 'P'], 'rows': 10} display = {'text': text, 'help': help, 'options_format': options_format, 'footer': footer} return display, options