Advertisement
Kovitikus

pc return desc

Aug 3rd, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.86 KB | None | 0 0
  1. '''
  2. In game result:
  3.  
  4. You see a very tall ample male. He has light grey eyes set above a hooked nose, pouting lips and a distinguished chin in a freckled sallow face. He is bald.
  5.  
  6. '''
  7.  
  8. class Player_Character(DefaultCharacter):
  9.     def return_appearance(self, looker, **kwargs):
  10.         if not looker:
  11.             return ""
  12.        
  13.         # get description, build string
  14.         string  = self.create_desc()
  15.         return string
  16.  
  17.     def create_desc(self):
  18.         desc = ""
  19.        
  20.         figure = self.db.figure
  21.         facial = self.db.facial
  22.         hair = self.db.hair
  23.  
  24.         height = figure.get('height')
  25.         build = figure.get('build')
  26.         gender = figure.get('gender')
  27.  
  28.         eye_color = facial.get('eye_color')
  29.         nose = facial.get('nose')
  30.         lips = facial.get('lips')
  31.         chin = facial.get('chin')
  32.         face = facial.get('face')
  33.         skin_color = facial.get('skin_color')
  34.  
  35.         length = hair.get('length')
  36.         texture = hair.get('texture')
  37.         hair_color = hair.get('hair_color')
  38.         style = hair.get('style')
  39.  
  40.         # The figure should result in "You see a <height> <build> <gender>."
  41.         desc += f"You see a {height} {build} {gender}. "
  42.        
  43.         # The facial should result in "He has <color> eyes set above an <shape> nose, <shape> lips and a <shape> chin in a <shape> <color> face."
  44.         gender = ('He' if gender == 'male' else 'She')
  45.         desc += f"{gender} has {eye_color} eyes set above a {nose} nose, "
  46.         desc += f"{lips} lips and a {chin} chin in a {face} {skin_color} face. "
  47.  
  48.         # The hair should result in "<gender> has <length> <texture> <color> hair <style>."
  49.         if length == 'bald':
  50.             desc += f"{gender} is {length}. "
  51.         else:
  52.             desc += f"{gender} has {length} {texture} {hair_color} hair {style}. "
  53.         return desc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement