daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest May 17th, 2018 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import copy
  2.  
  3.  
  4. class Item():
  5.  
  6.     def __init__(self, item_name=None, item_description=None, item_abilities={}):
  7.         self.name = item_name
  8.         self.description = item_description
  9.         self.abilities = copy.deepcopy(item_abilities)
  10.  
  11.  
  12.     def set_name(self, item_name):
  13.         self.name = item_name
  14.  
  15.  
  16.     def get_name(self):
  17.         return self.name
  18.  
  19.  
  20.     def set_description(self, item_description):
  21.         self.description = item_description
  22.  
  23.  
  24.     def set_ability(self, item_ability, item_ability_effect):
  25.         self.abilities[item_ability] = item_ability_effect
  26.  
  27.  
  28.     def describe(self):
  29.         return self.description
  30.  
  31.  
  32.     def get_details(self):
  33.         print('\nThe', self.name)
  34.         print('-' * (len(self.name) + 4))
  35.         print(self.description)
  36.         for ability in self.abilities:
  37.             print(ability + ':', self.abilities[ability])
RAW Paste Data
Top