示例#1
0
文件: guild.py 项目: btdevel/bt
import pygame

import bt.game.action as action
from bt.game.handler import (MultiScreenHandler, Screen, continue_screen)
from bt.game.movement import Direction
from bt.game.app import app


class GuildHandler(MultiScreenHandler):
    pass

guild = GuildHandler("inside/guild.png", location="The guild")

# The main screen
screen = Screen()
screen.add_message("Thou art in the Guild of Adventurers.\n ")
screen.add_option('Add member', 'aA', action.change_screen("add_member"))
screen.add_option('Remove member', 'rR', action.change_screen("remove_member"))
screen.add_option('Create a member', 'cC', action.change_screen("create_member"))
screen.add_option('Delete a member', 'dD', action.change_screen("delete_member"))
screen.add_option('Save party', 'sS', action.change_screen("save_party"))
screen.add_option('Leave game', 'lL', action.change_screen("leave_game"))
screen.add_option('Enter the city', 'eE',
#                  action.enter_city(pos=[2, 3], newdir=Direction.NORTH))
                  action.enter_city(pos=[25, 15], newdir=Direction.NORTH))
guild.add_screen("main", screen)
del screen

# The leave Game screen
screen = Screen()
screen.set_cancel_screen("main")
示例#2
0
文件: buildings.py 项目: btdevel/bt
class IronGateHandler(TurnBackHandler):
    def __init__(self, filename, message, location=""):
        DefaultBuildingHandler.__init__(self, filename, message, exit_action=action.turn_back(), location=location)

iron_gate_mangar = IronGateHandler("city/gate.png", "You stand before an iron gate, beyond which stands Mangar's tower.", location="Iron Gate")
iron_gate_kylearan = IronGateHandler("city/gate.png", "You stand before an iron gate, beyond which stands Kylearan's tower.", location="Iron Gate")


city_gate = TurnBackHandler("city/city_gate.png", "You stand before the city gates, which are blocked by a gigantic snow drift.", location="City Gate")

app.values["charname"] = "DESMET IRKM"





# Entrance to sewers
class SewersEntryHandler(MultiScreenHandler):
    pass

sewers_entrance = SewersEntryHandler(None, location="Portal...")

screen = Screen()
screen.add_message("There is an entrance to the city sewers here. Do you wish to take it?\n ")
screen.add_option('Yes', 'yY', action.turn_back())
screen.add_option('No', 'nN', action.turn_back())
sewers_entrance.add_screen("main", screen)


示例#3
0
文件: tavern.py 项目: btdevel/bt
import pygame
import bt.game.action as action
from bt.game.handler import MultiScreenHandler, Screen

class TavernHandler(MultiScreenHandler):
    pass

tavern = TavernHandler("inside/pub.png", location="Tavern")
pub = tavern

tavern_greeting_screen = Screen()
tavern_greeting_screen.add_message("Hail, travelers! Step to the bar and I'll draw you a tankard.")
tavern_greeting_screen.add_message("\nYou can:\n")
tavern_greeting_screen.add_option('Order a drink', 'oO', action.change_screen("order"))
tavern_greeting_screen.add_option('Talk to barkeep', 'tT', action.change_screen("talk"))
tavern_greeting_screen.add_message("\n\n\n")
tavern_greeting_screen.add_option('(EXIT)', 'eE', action.exit_building(), pos= -1, center=True)

tavern_order_screen = Screen()
tavern_order_screen.add_message("Seat thyself, %(charname)s. We've got...\n")
tavern_order_screen.add_option("Ale", "aA", action.message("Not bad!!"))
tavern_order_screen.add_option("Beer", "bB", action.message("Not bad!!"))
tavern_order_screen.add_option("Mead", "mM", action.message("Not bad!!"))
tavern_order_screen.add_option("Foul spirits", "fF", action.message("You don't feel too well."))
tavern_order_screen.add_option("Ginger Ale", "gG", action.message("The girls in the tavern are not impressed."))
tavern_order_screen.add_option("Wine", "wW", action.message("The barkeep says, \"Go down to the cellar and pick out a bottle.\""))
tavern_order_screen.add_message("\n\nWhat'll it be?")
tavern_order_screen.add_option('(CANCEL)', 'cC', action.change_screen("greeting"), pos= -1, center=True)

tavern_talk_screen = Screen()
tavern_talk_screen.add_message("\"Talk ain't cheap,\" the barkeep says.")
示例#4
0
文件: review.py 项目: btdevel/bt
import bt.game.action as action
from bt.game.handler import MultiScreenHandler, Screen, continue_screen
from bt.game.movement import Direction


class ReviewHandler(MultiScreenHandler):
    pass


review = ReviewHandler("inside/review.png", location="Review board")

screen = Screen()
screen.add_message("Wouldst thou like to be reviewed for:\n ")
screen.add_option("Advancement", "aA", action.change_screen("advancement"))
screen.add_option("Spell Acquiring", "sS", action.change_screen("spell_acquiring"))
screen.add_option("Class Change", "cC", action.change_screen("class_change"))
screen.add_option("(EXIT)", "eE", action.turn_back(), pos=-1, center=True)
review.add_screen("main", screen)


def not_implemented():
    return continue_screen("\nNot implemented yet.", target="main")


review.add_screen("advancement", not_implemented())
review.add_screen("spell_acquiring", not_implemented())
review.add_screen("class_change", not_implemented())


# The review Board is closed for the evening. The guild
# leaders will meet with you in the morning.