return 'Did you mean to write something on the paper?' cons.write( 'You write "%s" on the paper and feel a magical shift occur.' % self.written_on) self.emit( "&nD%s writes something on the paper and vanishes before your eyes!" % cons.user.id, cons.user) del self.location.exits['west'] try: self.location.exits['west'] = self.written_on except KeyError: cons.write( 'The text on the paper morphs back into the word "woods".') self.written_on = 'woods' self.location.exits['west'] = Thing.ID_dict[self.written_on] self.long_desc = 'This magical paper says "%s" on it.' % self.written_on return True waterfall = Room('waterfall') waterfall.set_description( 'beautiful waterfall base', 'This is a beautiful waterfall base. From here you can stand and look at the rushing waterfall. This place makes you feel peaceful inside and happy. You will always remember this place.' ) waterfall.add_adjectives('waterfall', 'beautiful', 'special') waterfall.add_names('place', 'base') waterfall.add_exit('west', 'woods') paper = PlaceChooser('magic paper', 'trunk of a tree') paper.move_to(waterfall)
from thing import Thing from room import Room from console import Console ## ## "game" is a special global variable, an object of class Game that holds ## the actual game state. ## game = Game() nulspace = Room( 'nulspace', pref_id=None ) #"nulspace" is a room for objects that should be deleted. TODO: Automaticly delete items from nulspace every 10 heartbeats. nulspace.game = game nulspace.set_description( 'void', 'This is an empty void where dead and destroyed things go. Good luck getting out!' ) nulspace.add_names('void') nulspace.add_exit('north', 'nulspace') nulspace.add_exit('south', 'nulspace') nulspace.add_exit('east', 'nulspace') nulspace.add_exit('west', 'nulspace') game.events.schedule(game.time + 5, game.clear_nulspace) game.nulspace = nulspace Thing.game = game start_room_mod = importlib.import_module('domains.school.school.great_hall') start_room = start_room_mod.load() game.start_loop()
south_shopping_one.set_description('street covered with shops', 'This is a street covered with shops on two stories--ground floor and the floor above. To get to the higher shops you must fly, which is made possible by the sapphires you see mounted in the roadway. A restaurant called "Gathernia" catches your eye.') #TODO: Auto generate more shops (like books on the bookshelf) restraunt_one.set_description('busy restaurant named Gathernia', 'This is a busy restaurant named "Gathernia". Here you see many people eating and talking.') central_fountain.add_exit('north', government_entrences.id) central_fountain.add_exit('south', south_shopping_one.id) government_entrences.add_exit('south', central_fountain.id) south_shopping_one.add_exit('north', central_fountain.id) restraunt_one.add_exit('out', south_shopping_one.id) south_shopping_one.add_enter('gathernia', restraunt_one.id) central_fountain.add_adjectives('busy', 'central') government_entrences.add_adjectives('dark', 'cobbled') south_shopping_one.add_adjectives('lively', 'bright', 'busy') government_entrences.add_names('street') fountain = Scenery('fountain', 'crystal clear fountain', 'This is studded with gems in the center. All of the water coming out of the fountain is crystal clear.') fountain.add_adjectives('gem-studded', 'crystal','clear') fountain.move_to(central_fountain) silemon = DeepPocketSignUpWizard(government_entrences) silemon.move_to(government_entrences) for i in range(1, 6): table = Container('table') table.set_description("wooden table numbered %s" % i, "This is a slightly battered wooden table at the restraunt. It has a number %s on it." % i) table.fix_in_place("The table is too heavy and awkward to move.") table.add_adjectives("wooden", "battered", "%s" % i, "table", "numbered") table.add_names("%s" % i) table.set_prepositions("on", "onto")