Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def title(self, noprefix=False, noart=False, nosuffix=False, notitle=False):
- """
- Fancy format an object name in a VR-context. Mainly used by
- return_appearance() to pretty-print room contents but may have other
- uses as well.
- """
- # Initialize.
- out = []
- title = self.key
- # First check for the specific and general tags.
- if not noart:
- if self.tags.get("specific"):
- out.append("the")
- elif self.tags.get("general"):
- if title and title[0] in 'aeiou':
- out.append('an')
- else:
- out.append('a')
- # Add the prefix, 'UNN', 'Lord', 'Captain', etc.
- if not noprefix:
- x = (self.db.prefix or '')
- x and out.append(x)
- # Add the base name.
- out.append(title)
- # Add the suffix, 'Jr', 'III', 'Esquire', etc.
- if not nosuffix:
- x = (self.db.suffix or '')
- x and out.append(x)
- return utils.capstr(' '.join(out))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement