Exemplo n.º 1
0
 def load(self):
     dictinfo = flatFileParse(self.filename)
     self.name = textRead(dictinfo['name'])
     self.password = textRead(dictinfo['password'])
     self.capability = listRead(dictinfo['capability'])
     self.lasthost = textRead(dictinfo['lasthost'])
     self.lasttime = textRead(dictinfo['lasttime'])
     newroom = int(textRead(dictinfo['location']))
     newroom = area.roomByVnum(newroom)
     self.location = newroom
     self.move(newroom)
     self.long_description = textRead(dictinfo['long description'])
     self.short_description = textRead(dictinfo['short description'])
     self.race = races.racebyname(textRead(dictinfo['race']))
     self.age = int(textRead(dictinfo['age']))
     self.gender = textRead(dictinfo['gender'])
     self.level = int(textRead(dictinfo['level']))
     self.alignment = textRead(dictinfo['alignment'])
     self.money = dictRead(dictinfo['money'])
     self.height = dictRead(dictinfo['height'])
     self.weight = int(textRead(dictinfo['weight']))
     self.maxhp = int(textRead(dictinfo['maxhp']))
     self.currenthp = int(textRead(dictinfo['currenthp']))
     self.maxmovement = int(textRead(dictinfo['maxmovement']))
     self.currentmovement = int(textRead(dictinfo['currentmovement']))
     self.maxwillpower = int(textRead(dictinfo['maxwillpower']))
     self.currentwillpower = int(textRead(dictinfo['currentwillpower']))
     self.totalmemoryslots = dictRead(dictinfo['totalmemoryslots'])
     self.memorizedspells = dictRead(dictinfo['memorizedspells'])
     self.hitroll = int(textRead(dictinfo['hitroll']))
     self.damroll = int(textRead(dictinfo['damroll']))
     self.wimpy = int(textRead(dictinfo['wimpy']))
     self.title = textRead(dictinfo['title'])
     self.guild = textRead(dictinfo['guild'])
     self.council = textRead(dictinfo['council'])
     self.family = textRead(dictinfo['family'])
     self.clan = textRead(dictinfo['clan'])
     self.deity = textRead(dictinfo['deity'])
     self.skillpoints = int(textRead(dictinfo['skillpoints']))
     self.seen_as = textRead(dictinfo['seen as'])
     self.maximum_stat = dictRead(dictinfo['maximum stat'])
     self.current_stat = dictRead(dictinfo['current stat'])
     self.discipline = textRead(dictinfo['discipline'])
     self.aesthetic = textRead(dictinfo['aesthetic'])
     self.exp = dictRead(dictinfo['exp'])
     self.inventory = listRead(dictinfo['inventory'])
     self.worn = dictRead(dictinfo['worn'])
     self.baceac = dictRead(dictinfo['baceac'])
     self.currentac = dictRead(dictinfo['currentac'])
     self.hunger = int(textRead(dictinfo['hunger']))
     self.thirst = int(textRead(dictinfo['thirst']))
     self.position = textRead(dictinfo['position'])
     self.aid = textRead(dictinfo['aid'])
     self.knownpeople = dictRead(dictinfo['known people'])
     self.prompt = textRead(dictinfo['prompt'])
     self.alias = dictRead(dictinfo['alias'])
Exemplo n.º 2
0
 def get_roll_stats(self, inp):
     inp = inp.lower()
     if inp == 'y' or inp == 'yes':
         self.sock.dispatch(helpsys.get_help('motd', server=True))
         self.sock.dispatch('')
         newplayer = player.Player()
         newplayer.filename = "{0}/{1}".format(world.playerDir, self.name)
         testsock = self.sock
         newplayer.name = self.name
         newplayer.password = self.password
         newplayer.capability.append('player')
         newplayer.lasttime = time.ctime()
         newplayer.lasthost = self.sock.host
         newplayer.race = self.newchar['race']
         newplayer.aid = self.newchar['aid']
         newplayer.gender = self.newchar['gender']
         newplayer.discipline = self.newchar['discipline']
         newplayer.aesthetic = self.newchar['aesthetic']
         newplayer.position = 'standing'
         newplayer.maximum_stat = self.newstats
         newplayer.current_stat = self.newstats
         self.clear()
         newplayer.sock = testsock
         newplayer.sock.owner = newplayer
         newplayer.prompt = '{papmMUD{g:{x '
         newplayer.sock.promptable = True
         newplayer.write = newplayer.sock.dispatch
         player.playerlist.append(newplayer)
         newroom = area.roomByVnum(101)
         newplayer.move(newroom)
         newplayer.alias['s'] = 'south'
         newplayer.alias['n'] = 'north'
         newplayer.alias['e'] = 'east'
         newplayer.alias['w'] = 'west'
         newplayer.alias['ne'] = 'northeast'
         newplayer.alias['nw'] = 'northwest'
         newplayer.alias['sw'] = 'southwest'
         newplayer.alias['se'] = 'southeast'
         newplayer.alias['l'] = 'look'
         newplayer.alias['page'] = 'beep'
         newplayer.interp('look')
         newplayer.save()
         comm.wiznet("{0} is a new character entering APM.".format(newplayer.name))
         del(self)
     else:
         self.roll_stats()
         self.show_stats()
         self.sock.dispatch('Are these statistics acceptable? ', trail=False)