Exemplo n.º 1
0
def start_campaign(init, screen):
    pygwrap.please_stand_by(screen, "Building world...")
    nart = narrator.Narrative(campaign.Campaign(), init)
    if nart.story:
        nart.build()
        camp = nart.camp
        pcs = choose_characters(screen)
        if pcs:
            camp.name = pygwrap.input_string(screen, redrawer=PosterRedraw(screen), prompt="Enter campaign name")
            camp.add_party(pcs)
            camp.place_party()
            camp.play(screen)
Exemplo n.º 2
0
def start_campaign( init, screen ):
    pygwrap.please_stand_by( screen, "Building world..." )
    nart = narrator.Narrative( campaign.Campaign(), init )
    if nart.story:
        nart.build()
        camp = nart.camp
        pcs = choose_characters( screen )
        if pcs:
            camp.name = pygwrap.input_string(screen, redrawer=PosterRedraw(screen), prompt="Enter campaign name" )
            camp.add_party( pcs )
            camp.place_party()
            camp.play( screen )
Exemplo n.º 3
0
def bardic_start_campaign(screen):
    init = narrator.plots.PlotState(rank=1)
    pygwrap.please_stand_by(screen, "Building world...")
    nart = narrator.Narrative(campaign.Campaign(), init, adv_type="STUB_BARDIC", end_rank=5)
    if nart.story:
        nart.build()
        camp = nart.camp
        pcs = choose_characters(screen)
        if pcs:
            camp.name = pygwrap.input_string(screen, redrawer=PosterRedraw(screen), prompt="Enter campaign name")
            camp.add_party(pcs)
            camp.place_party()
            camp.play(screen)
Exemplo n.º 4
0
def bardic_start_campaign( screen ):
    init = narrator.plots.PlotState(rank=1)
    pygwrap.please_stand_by( screen, "Building world..." )
    nart = narrator.Narrative( campaign.Campaign(), init, adv_type="STUB_BARDIC", end_rank=5 )
    if nart.story:
        nart.build()
        camp = nart.camp
        pcs = choose_characters( screen )
        if pcs:
            camp.name = pygwrap.input_string(screen, redrawer=PosterRedraw(screen), prompt="Enter campaign name" )
            camp.add_party( pcs )
            camp.place_party()
            camp.play( screen )
Exemplo n.º 5
0
def make_character( screen ):
    """Generate and return a new player character."""
    # We're gonna use the same redrawer for this entire process.
    redraw = charsheet.MenuRedrawer( screen = screen )

    # Get gender.
    gender = choose_gender( screen , redraw )
    if gender is False:
        return None

    # Get species.
    species = choose_species( screen , redraw )
    if not species:
        return None

    pc = characters.Character( species = species(), gender = gender )
    redraw.charsheet = charsheet.CharacterSheet( pc , screen = screen )

    # Roll stats and pick a class.
    level = choose_level( screen, redraw, pc )
    if not level:
        return None

    pc.levels.append( level(1,pc) )
    give_starting_equipment( pc )
    redraw.charsheet.regenerate_avatar()

    # Customize appearance.
    choose_appearance( screen, redraw, pc )

    # Choose a name.
    redraw.caption = "Done!"
    name = pygwrap.input_string( screen, redrawer=redraw, prompt="Enter character name" )
    if name:
        pc.name = name
        pc.choose_random_spells()
        return pc
    else:
        return None
Exemplo n.º 6
0
def create_new_level( screen ):
    rpm = rpgmenu.Menu( screen , x=screen.get_width()/2 - 200 , y=screen.get_height()/2 - 130, w=400, h=300 )
    myredraw = MenuRedrawer( "Select Width" , screen )
    for t in range( 20 , 305 , 10 ):
        rpm.add_item( "Width: " + str( t ) , t )
    rpm.predraw = myredraw
    width = rpm.query()

    if width:
        rpm = rpgmenu.Menu( screen , x=screen.get_width()/2 - 200 , y=screen.get_height()/2 - 130, w=400, h=300 )
        for t in range( 20 , 205 , 10 ):
            rpm.add_item( "Height: " + str( t ) , t )
        myredraw.caption = "Select Height"
        rpm.predraw = myredraw
        height = rpm.query()

        if height:
            the_level = maps.Map(width=width,height=height)
            select_backdrop( the_level , screen )
            myredraw.caption = "Enter Filename"
            fname = pygwrap.input_string( screen, rpgmenu.MENUFONT, redrawer=myredraw, prompt="Enter Filename")
            the_level.fname = fname
            edit_map( the_level , screen )
Exemplo n.º 7
0
def make_character(screen):
    """Generate and return a new player character."""
    # We're gonna use the same redrawer for this entire process.
    redraw = charsheet.MenuRedrawer(screen=screen)
    rpm = charsheet.RightMenu(screen, predraw=redraw)

    # rpm.query()

    # Get gender.
    gender = choose_gender(screen, redraw)
    if gender is False:
        return None
    redraw.caption = "Select this character's Race"
    # Get species.
    species = choose_species(screen, redraw)

    while species is 0:
        gender = choose_gender(screen, redraw)
        redraw.caption = "Select this character's Race"
        species = choose_species(screen, redraw)
        if not species or not gender:
            return None
    if not species:
        return None

    #displays the character sprite based on the gender and race selection
    pc = characters.Character(species=species(), gender=gender)
    redraw.charsheet = charsheet.CharacterSheet(pc, screen=screen)

    # Roll stats and pick a class.
    level = choose_level(screen, redraw, pc)
    redraw.charsheet = charsheet.CharacterSheet(pc, screen=screen)
    redraw.charsheet.regenerate_avatar()
    if not level:
        return None

    while level == 'change':
        temp = choose_species(screen, redraw)
        while temp is 0:
            gender = choose_gender(screen, redraw)
            pc = characters.Character(species=species(), gender=gender)
            redraw.charsheet = charsheet.CharacterSheet(pc, screen=screen)
            temp = choose_species(screen, redraw)
        species = temp
        pc = characters.Character(species=species(), gender=gender)
        redraw.charsheet = charsheet.CharacterSheet(pc, screen=screen)
        level = choose_level(screen, redraw, pc)

    redraw.charsheet.regenerate_avatar()

    # Customize appearance.
    d = choose_appearance(screen, redraw, pc)

    done = 1
    while done != 0:
        done = final_looks(screen, redraw, pc)
        if done == 1:
            gender = choose_gender(screen, redraw)
            pc = characters.Character(species=species(), gender=gender)
            redraw.charsheet = charsheet.CharacterSheet(pc, screen=screen)
            redraw.charsheet.regenerate_avatar()
        if done == 2:
            species = choose_species(screen, redraw)
            pc = characters.Character(species=species(), gender=gender)
            redraw.charsheet = charsheet.CharacterSheet(pc, screen=screen)
            redraw.charsheet.regenerate_avatar()
            level = choose_level(screen, redraw, pc)
            if not level:
                return None
        if done == 3:
            level = choose_level(screen, redraw, pc)
            if not level:
                return None
        if done == 4:
            d = choose_appearance(screen, redraw, pc)

    pc.levels.append(level(1, pc))
    give_starting_equipment(pc)
    redraw.charsheet.regenerate_avatar()

    # Choose a name.
    redraw.caption = "Done!"
    name = pygwrap.input_string(screen,
                                redrawer=redraw,
                                prompt="Enter character name")
    if name:
        pc.name = name
        pc.choose_random_spells()
        return pc
    else:
        return None