Exemple #1
0
def menunode_select_archetype(caller, raw_string):
    """Archetype detail and selection menu node."""
    arch = archetypes.VALID_ARCHETYPES[int(raw_string.strip()) - 1]
    arch = archetypes.load_archetype(arch)
    text = arch.ldesc + "Would you like to become this archetype?"
    help = "Examine the properties of this archetype and decide whether\n"
    help += "to use its starting attributes for your character."
    options = ({"key": ("Yes", "ye", "y"),
                "desc": "Become {} {}".format("an" if arch.name[0] == 'A'
                                              else "a",
                                              arch.name),
                "exec": lambda s: archetypes.apply_archetype(s.new_char, arch.name,
                                                             reset=True),
                "goto": "menunode_allocate_traits"},
               {"key": ("No", "n", "_default"),
                "desc": "Return to Archetype selection",
                "goto": "menunode_welcome_archetypes"})
    return (text, help), options
Exemple #2
0
def menunode_select_archetype(caller, raw_string):
    """Archetype detail and selection menu node."""
    arch = archetypes.VALID_ARCHETYPES[int(raw_string.strip()) - 1]
    arch = archetypes.load_archetype(arch)
    text = arch.ldesc + "Would you like to become this archetype?"
    help = "Examine the properties of this archetype and decide whether\n"
    help += "to use its starting attributes for your character."
    options = ({"key": ("Yes", "ye", "y"),
                "desc": "Become {} {}".format("an" if arch.name[0] == 'A'
                                              else "a",
                                              arch.name),
                "exec": lambda s: archetypes.apply_archetype(s.new_char, arch.name,
                                                             reset=True),
                "goto": "menunode_allocate_traits"},
               {"key": ("No", "n", "_default"),
                "desc": "Return to Archetype selection",
                "goto": "menunode_welcome_archetypes"})
    return (text, help), options
Exemple #3
0
def menunode_welcome_archetypes(caller):
    """Starting page and Archetype listing."""
    text = dedent("""\
        |wWelcome to |mDimensions RPG|w, a MUSH/RPG chat built with |yEvennia|w.|n

        To begin, select a |cClass|n.

        Select a class by number below to view its details, or |whelp|n
        at any time for more info.
    """)
    help = fill("In |mDimensions|n, character |cClasses|n represent the "
                "characters' archetype or primary role. The various classes "
                "have different strengths and weaknesses, which are reflected "
                "in your character's starting traits.")
    options = []
    for arch in archetypes.VALID_ARCHETYPES:
        a = archetypes.load_archetype(arch)
        options.append({"desc": "|c{}|n".format(a.name),
                        "goto": "menunode_select_archetype"})
    return (text, help), options
Exemple #4
0
def menunode_welcome_archetypes(caller):
    """Starting page and Archetype listing."""
    text = dedent("""\
        |wWelcome to |mAinneve|w, the example game for |yEvennia|w.|n

        To begin, select an |cArchetype|n. There are three base
        archetypes to choose from, plus three dual archetypes which
        combine the strengths and weaknesses of two archetypes into one.

        Select an Archetype by number below to view its details, or |whelp|n
        at any time for more info.
    """)
    help = fill("In |mAinneve|n, character |cArchetypes|n represent the "
                "characters' class or primary role. The various archetypes "
                "have different strengths and weaknesses, which are reflected "
                "in your character's starting traits.")
    options = []
    for arch in archetypes.VALID_ARCHETYPES:
        a = archetypes.load_archetype(arch)
        options.append({"desc": "|c{}|n".format(a.name),
                        "goto": "menunode_select_archetype"})
    return (text, help), options
Exemple #5
0
def menunode_welcome_archetypes(caller):
    """Starting page and Archetype listing."""
    text = dedent("""\
        |wWelcome to |mAinneve|w, the example game for |yEvennia|w.|n

        To begin, select an |cArchetype|n. There are three base
        archetypes to choose from, plus three dual archetypes which
        combine the strengths and weaknesses of two archetypes into one.

        Select an Archetype by number below to view its details, or |whelp|n
        at any time for more info.
    """)
    help = fill("In |mAinneve|n, character |cArchetypes|n represent the "
                "characters' class or primary role. The various archetypes "
                "have different strengths and weaknesses, which are reflected "
                "in your character's starting traits.")
    options = []
    for arch in archetypes.VALID_ARCHETYPES:
        a = archetypes.load_archetype(arch)
        options.append({"desc": "|c{}|n".format(a.name),
                        "goto": "menunode_select_archetype"})
    return (text, help), options
 def test_load_archetype(self):
     """confirm `load_archetype` returns correct class instance"""
     at = archetypes.load_archetype('warrior')
     self.assertEqual(at.name, 'Warrior')
     self.assertEqual(at.health_roll, '1d6+1')
     at = archetypes.load_archetype('scout')
     self.assertEqual(at.name, 'Scout')
     self.assertEqual(at.health_roll, '1d6')
     at = archetypes.load_archetype('arcanist')
     self.assertEqual(at.name, 'Arcanist')
     self.assertEqual(at.health_roll, '1d6-1')
     at = archetypes.load_archetype('warrior-arcanist')
     self.assertEqual(at.name, 'Warrior-Arcanist')
     self.assertEqual(at.health_roll, '1d6-1')
     at = archetypes.load_archetype('warrior-scout')
     self.assertEqual(at.name, 'Warrior-Scout')
     self.assertEqual(at.health_roll, '1d6')
     at = archetypes.load_archetype('arcanist-scout')
     self.assertEqual(at.name, 'Arcanist-Scout')
     self.assertEqual(at.health_roll, '1d6-1')
 def test_load_archetype(self):
     for k, v in self.at_data.iteritems():
         a = archetypes.load_archetype(k)
         self.assertIsInstance(a, archetypes.Archetype)