def load(self): """ Uses self.path to get a file location to load the command data. Loads the data, assigns instance variables based on the data. Compiles the code from from the file into a code object to be used in eval() when the command is called. Keyword arguments: None Return value: None Example: None Additional notes: None """ dictinfo = flatFileParse(self.path) self.name = dictinfo['name'] self.capability = dictinfo['capability'] self.description = dictinfo['description'] self.disabled = dictinfo['disabled'] self.racelim = listRead(dictinfo['racelim']) self.classlim = listRead(dictinfo['classlim']) self.skilllim = dictRead(dictinfo['skilllim']) self.noview = dictinfo['noview'] try: self.compiled = compile(self.description, 'tmp', 'exec') except Exception as msg: print("Error compiling {0}.\n{1}\n".format(self.name, msg)) self.disabled = 'true'
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'])
def load(self, data): data = data.split('~') data = [item.strip() for item in data if item.strip() != ''] dictinfo = {} for thing in data: first = thing.index('|') dictinfo[thing[:first].strip()] = thing[first + 1:].strip() self.vnum = dictinfo['vnum'] self.vnum = int(self.vnum) self.area.roomlist[self.vnum] = self area.roomlist[self.vnum] = self self.name = dictinfo['name'] self.description = dictinfo['description'] exitdata = dictRead(dictinfo['exits']) for oneexit in list(exitdata.keys()): self.exits[oneexit] = exits.Exit(self, ' '.join([oneexit, exitdata[oneexit]])) self.flags = listRead(dictinfo['flags']) self.sectortype = listRead(dictinfo['sector type']) self.propertyvalue = dictinfo['property value'] self.extradescriptions = dictRead(dictinfo['extra descriptions'])
def load(self): dictinfo = flatFileParse(self.path) self.name = dictinfo['name'] self.description = dictinfo['description'] self.alignment = listRead(dictinfo['alignment']) self.playable = dictinfo['playable'] self.descriptive = dictinfo['descriptive'] self.size = dictinfo['size'] self.heightfeet = int(dictinfo['heightfeet']) self.heightinches = int(dictinfo['heightinches']) self.undead = dictinfo['undead'] self.weight = int(dictinfo['weight']) self.ageminimum = int(dictinfo['ageminimum']) self.agemaximum = int(dictinfo['agemaximum']) self.baslashing = int(dictinfo['baslashing']) self.babashing = int(dictinfo['babashing']) self.bapiercing = int(dictinfo['bapiercing']) self.balashing = int(dictinfo['balashing']) self.brfire = int(dictinfo['brfire']) self.brice = int(dictinfo['brice']) self.brlightning = int(dictinfo['brlightning']) self.brearth = int(dictinfo['brearth']) self.brdisease = int(dictinfo['brdisease']) self.brpoison = int(dictinfo['brpoison']) self.brmagic = int(dictinfo['brmagic']) self.brholy = int(dictinfo['brholy']) self.brmental = int(dictinfo['brmental']) self.brphysical = int(dictinfo['brphysical']) self.wearlocations = listRead(dictinfo['wearlocations']) self.bodyparts = listRead(dictinfo['bodyparts']) self.skin = listRead(dictinfo['skin']) self.eyes = listRead(dictinfo['eyes']) self.hair = listRead(dictinfo['hair']) self.speed = dictinfo['speed'] self.speed = int(self.speed) self.agility = dictinfo['agility'] self.agility = int(self.agility) self.strength = dictinfo['strength'] self.strength = int(self.strength) self.intelligence = dictinfo['intelligence'] self.intelligence = int(self.intelligence) self.wisdom = dictinfo['wisdom'] self.wisdom = int(self.wisdom) self.charisma = dictinfo['charisma'] self.charisma = int(self.charisma) self.luck = dictinfo['luck'] self.luck = int(self.luck) self.constitution = dictinfo['constitution'] self.constitution = int(self.constitution) self.start_location = dictRead(dictinfo['start_location']) self.special_skills = dictRead(dictinfo['special_skills'])
def load(self): """ Open the area data file located at self.path. Assigns the data read into the instance variables. Keyword arguments: None Return value: None Example: None Additional notes: None """ dictinfo = flatFileParse(self.path) self.creator = dictinfo['creator'] self.viewable = dictinfo['viewable'] self.keywords = listRead(dictinfo['keywords']) self.topics = dictinfo['topics'] self.section = dictinfo['section'] self.description = dictinfo['description']