Exemplo n.º 1
0
 def save(self):
     """ Opens the file associated with the location in self.path and writes the command header data
         as well as the code to the command file.
     
     Keyword arguments:
         None
         
     Return value:
         None
         
     Example:
         None
         
     Additional notes:
         None
         
     """
     with open(self.path, 'w') as thefile:
         thefile.write('name | {0}~\n'.format(self.name))
         thefile.write('capability | {0}~\n'.format(self.capability))
         thefile.write('description | {0}~\n'.format(self.description))
         thefile.write('disabled | {0}~\n'.format(self.disabled))
         thefile.write('racelim | {0}~\n'.format(listWrite(self.racelim)))
         thefile.write('classlim | {0}~\n'.format(listWrite(self.classlim)))
         thefile.write('skilllim | {0}~\n'.format(dictWrite(self.skilllim)))
         thefile.write('noview | {0}~\n'.format(self.noview))
Exemplo n.º 2
0
 def save(self):
     with open(self.filename, 'w') as thefile:
         thefile.write('name | {0}~\n'.format(self.name))
         thefile.write('password | {0}~\n'.format(self.password))
         thefile.write('capability | {0}~\n'.format(listWrite(self.capability)))
         thefile.write('lasthost | {0}~\n'.format(self.lasthost))
         thefile.write('lasttime | {0}~\n'.format(self.lasttime))
         thefile.write('location | {0}~\n'.format(self.location.vnum))
         thefile.write('long description | {0}~\n'.format(self.long_description))
         thefile.write('short description | {0}~\n'.format(self.short_description))
         thefile.write('race | {0}~\n'.format(self.race.name))
         thefile.write('age | {0}~\n'.format(self.age))
         thefile.write('gender | {0}~\n'.format(self.gender))
         thefile.write('level | {0}~\n'.format(self.level))
         thefile.write('alignment | {0}~\n'.format(self.alignment))
         thefile.write('money | {0}~\n'.format(dictWrite(self.money)))
         thefile.write('height | {0}~\n'.format(dictWrite(self.height)))
         thefile.write('weight | {0}~\n'.format(self.weight))
         thefile.write('maxhp | {0}~\n'.format(self.maxhp))
         thefile.write('currenthp | {0}~\n'.format(self.currenthp))
         thefile.write('maxmovement | {0}~\n'.format(self.maxmovement))
         thefile.write('currentmovement | {0}~\n'.format(self.currentmovement))
         thefile.write('maxwillpower | {0}~\n'.format(self.maxwillpower))
         thefile.write('currentwillpower | {0}~\n'.format(self.currentwillpower))
         thefile.write('totalmemoryslots | {0}~\n'.format(dictWrite(self.totalmemoryslots)))
         thefile.write('memorizedspells | {0}~\n'.format(dictWrite(self.memorizedspells)))
         thefile.write('hitroll | {0}~\n'.format(self.hitroll))
         thefile.write('damroll | {0}~\n'.format(self.damroll))
         thefile.write('wimpy | {0}~\n'.format(self.wimpy))
         thefile.write('title | {0}~\n'.format(self.title))
         thefile.write('guild | {0}~\n'.format(self.guild))
         thefile.write('council | {0}~\n'.format(self.council))
         thefile.write('family | {0}~\n'.format(self.family))
         thefile.write('clan | {0}~\n'.format(self.clan))
         thefile.write('deity | {0}~\n'.format(self.deity))
         thefile.write('skillpoints | {0}~\n'.format(self.skillpoints))
         thefile.write('seen as | {0}~\n'.format(self.seen_as))
         thefile.write('maximum stat | {0}~\n'.format(dictWrite(self.maximum_stat)))
         thefile.write('current stat | {0}~\n'.format(dictWrite(self.current_stat)))
         thefile.write('discipline | {0}~\n'.format(self.discipline))
         thefile.write('aesthetic | {0}~\n'.format(self.aesthetic))
         thefile.write('exp | {0}~\n'.format(dictWrite(self.exp)))
         thefile.write('inventory | {0}~\n'.format(listWrite(self.inventory)))
         thefile.write('worn | {0}~\n'.format(dictWrite(self.worn)))
         thefile.write('baceac | {0}~\n'.format(dictWrite(self.baceac)))
         thefile.write('currentac | {0}~\n'.format(dictWrite(self.currentac)))
         thefile.write('hunger | {0}~\n'.format(self.hunger))
         thefile.write('thirst | {0}~\n'.format(self.thirst))
         thefile.write('position | {0}~\n'.format(self.position))
         thefile.write('aid | {0}~\n'.format(self.aid))
         thefile.write('known people | {0}~\n'.format(dictWrite(self.knownpeople)))
         thefile.write('prompt | {0}~\n'.format(self.prompt))
         thefile.write('alias | {0}~\n'.format(dictWrite(self.alias)))
Exemplo n.º 3
0
 def savedata(self):
     exitdata = {}
     for anexit in self.exits.keys():
         testoutput = self.exits[anexit].savedata()
         exitdata[str(anexit)] = testoutput
     retvalue = "vnum | {0}~\n"\
                "name | {1}~\n"\
                "description | {2}~\n"\
                "exits | {3}~\n"\
                "flags | {4}~\n"\
                "sector type | {5}~\n"\
                "property value | {6}~\n"\
                "extra descriptions | {7}~\n".format(
                   self.vnum, self.name, self.description,
                   dictWrite(exitdata),
                   listWrite(self.flags),
                   listWrite(self.sectortype),
                   self.propertyvalue,
                   dictWrite(self.extradescriptions))
     return retvalue
Exemplo n.º 4
0
 def save(self):
     """ Write all of our helpfile information out to a file(self.path)
     
     Keyword arguments:
         None
         
     Return value:
         None
         
     Example:
         None
         
     Additional notes:
         None
         
     """  
     with open(self.path, 'w') as thefile:
         thefile.write('creator | {0}~\n'.format(self.creator))
         thefile.write('viewable | {0}~\n'.format(self.viewable.lower()))
         thefile.write('keywords | {0}~\n'.format(listWrite(self.keywords)))
         thefile.write('topics | {0}~\n'.format(self.topics))
         thefile.write('section | {0}~\n'.format(self.section))
         thefile.write('description | {0}~\n'.format(self.description))
Exemplo n.º 5
0
 def save(self):
     with open(self.path, 'w') as thefile:
         thefile.write('name | {0}~\n'.format(self.name))
         thefile.write('description | {0}~\n'.format(self.description))
         thefile.write('alignment | {0}~\n'.format(listWrite(self.alignment)))
         thefile.write('playable | {0}~\n'.format(self.playable))
         thefile.write('descriptive | {0}~\n'.format(self.descriptive))
         thefile.write('size | {0}~\n'.format(self.size))
         thefile.write('heightfeet | {0}~\n'.format(self.heightfeet))
         thefile.write('heightinches | {0}~\n'.format(self.heightinches))
         thefile.write('undead | {0}~\n'.format(self.undead))
         thefile.write('weight | {0}~\n'.format(self.weight))
         thefile.write('ageminimum | {0}~\n'.format(self.ageminimum))
         thefile.write('agemaximum | {0}~\n'.format(self.agemaximum))
         thefile.write('baslashing | {0}~\n'.format(self.baslashing))
         thefile.write('babashing | {0}~\n'.format(self.babashing))
         thefile.write('bapiercing | {0}~\n'.format(self.bapiercing))
         thefile.write('balashing | {0}~\n'.format(self.balashing))
         thefile.write('brfire | {0}~\n'.format(self.brfire))
         thefile.write('brice | {0}~\n'.format(self.brice))
         thefile.write('brlightning | {0}~\n'.format(self.brlightning))
         thefile.write('brearth | {0}~\n'.format(self.brearth))
         thefile.write('brdisease | {0}~\n'.format(self.brdisease))
         thefile.write('brpoison | {0}~\n'.format(self.brpoison))
         thefile.write('brmagic | {0}~\n'.format(self.brmagic))
         thefile.write('brholy | {0}~\n'.format(self.brholy))
         thefile.write('brmental | {0}~\n'.format(self.brmental))
         thefile.write('brphysical | {0}~\n'.format(self.brphysical))
         thefile.write('wearlocations | {0}~\n'.format(listWrite(self.wearlocations)))
         thefile.write('bodyparts | {0}~\n'.format(listWrite(self.bodyparts)))
         thefile.write('skin | {0}~\n'.format(listWrite(self.skin)))
         thefile.write('eyes | {0}~\n'.format(listWrite(self.eyes)))
         thefile.write('hair | {0}~\n'.format(listWrite(self.hair)))
         thefile.write('speed | {0}~\n'.format(self.speed))
         thefile.write('agility | {0}~\n'.format(self.agility))
         thefile.write('strength | {0}~\n'.format(self.strength))
         thefile.write('intelligence | {0}~\n'.format(self.intelligence))
         thefile.write('wisdom | {0}~\n'.format(self.wisdom))
         thefile.write('charisma | {0}~\n'.format(self.charisma))
         thefile.write('luck | {0}~\n'.format(self.luck))
         thefile.write('constitution | {0}~\n'.format(self.constitution))
         thefile.write('start_location | {0}~\n'.format(dictWrite(self.start_location)))
         thefile.write('special_skills | {0}~\n'.format(dictWrite(self.special_skills)))