示例#1
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     # Initialize the current state of the door from the default settings:
     self._closed = self.closed
     self._locked = self.locked
     if 'to_room' in args:
         self.to_room = args.get('to_room')
示例#2
0
文件: area.py 项目: semtle/ShinyMUD
 def __init__(self, args={}):
     Model.__init__(self, args)
     self.rooms = {}
     self.items = {}
     self.npcs = {}
     self.scripts = {}
     self.time_of_last_reset = 0
     self.times_visited_since_reset = 0
示例#3
0
文件: area.py 项目: ElecRei/ShinyMUD
 def __init__(self, args={}):
     Model.__init__(self, args)
     self.rooms = {}
     self.items = {}
     self.npcs = {}
     self.scripts = {}
     self.time_of_last_reset = 0
     self.times_visited_since_reset = 0
示例#4
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     self.buys_types = []
     if not self.sale_items:
         #We only get here if this is the first instance of the merchant,
         # otherwise the merchandise will be loaded from load_extras()
         merch_dict = {'merchant': self}
         self.sale_items = MerchandiseList(merch_dict)
         self.sale_items.save()
示例#5
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     self.buys_types = []
     if not self.sale_items:
         #We only get here if this is the first instance of the merchant,
         # otherwise the merchandise will be loaded from load_extras()
         merch_dict = {'merchant': self}
         self.sale_items = MerchandiseList(merch_dict)
         self.sale_items.save()
示例#6
0
文件: room.py 项目: ElecRei/ShinyMUD
 def __init__(self, args={}):
     self.items = []
     self.exits = {'north': None,
                   'south': None,
                   'east': None,
                   'west': None,
                   'up': None,
                   'down': None}
     self.npcs = []
     self.spawns = {}
     self.players = {}
     Model.__init__(self, args)
示例#7
0
 def characterize(self, args={}):
     Model.__init__(self, args)
     self.atk = 0
     self.battle = None
     self._battle_target = None
     self.inventory = []
     self.equipped = {} #Stores current item in each slot from EQUIP_SLOTS
     for i in EQUIP_SLOTS.keys():
         self.equipped[i] = ''
     self.isequipped = [] #Is a list of the currently equipped items
     self._attack_queue = []
     self.hit = IntRegister()
     self.evade = IntRegister()
     self.absorb = DictRegister()
     self.damage = DamageRegister()
     self.effects = {}
     self.position = ('standing', None)
示例#8
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     # Both the "live" and "dead" lists contain dictionaries in the form:
     # {'id': item_id, 'area': item_area, 'name': item_name, 'price': price}
     #
     # Neither directly keeps track of items. If an item on the merchandise
     # list no longer exists, it will be stored in the 'dead' list. Dead
     # items are occationally checked on, and re-added to the 'live' list 
     # if the area gets re-imported. 
     #
     # Keywords are stored with live items so we can check quickly if they
     # are in the merchandise list. Keywords are not saved with their items,
     # and may not exist for dead items.
     if not self.live:
         self.live = []
     if not self.dead:
         self.dead = []
     
     self.resolve()        
示例#9
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     if args.get('script'):
         self.script = args.get('script')
示例#10
0
文件: item.py 项目: ei-grad/ShinyMUD
 def __init__(self, args={}):
     self.item_types = {}
     Model.__init__(self, args)
     if not self.keywords and self.name:
         self.keywords = self.name.lower().split()
示例#11
0
文件: spawn.py 项目: semtle/ShinyMUD
 def __init__(self, args={}):
     Model.__init__(self, args)
     self.spawn_object = args.get('obj')
     self.nested_spawns = []
示例#12
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     if args.get('script'):
         self.script = args.get('script')