Exemplo n.º 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')
Exemplo n.º 2
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')
Exemplo n.º 3
0
 def save(self, save_dict=None):
     if not self.to_room:
         # Quick Hack:
         # if for some reason the to_room to this room has become None, don't
         # save it! This should be fixed in later code so that it won't be
         # possible
         return
     Model.save(self)
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 def save(self, save_dict=None):
     if not self.to_room:
         # Quick Hack:
         # if for some reason the to_room to this room has become None, don't
         # save it! This should be fixed in later code so that it won't be
         # possible
         return
     Model.save(self)
Exemplo n.º 6
0
 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
Exemplo n.º 7
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()
Exemplo n.º 8
0
 def save(self):
     save_all = False
     if not self.dbid:
         save_all = True
     Model.save(self)
     if save_all:
         # First time build item is saved, save item_types.
         for value in self.item_types.values():
             value.save()
Exemplo n.º 9
0
 def save(self):
     save_all = False
     if not self.dbid:
         save_all = True
     Model.save(self)
     if save_all:
         # First time build item is saved, save item_types.
         for value in self.item_types.values():
             value.save()
Exemplo n.º 10
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()
Exemplo n.º 11
0
 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)
Exemplo n.º 12
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)
Exemplo n.º 13
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)
Exemplo n.º 14
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()
Exemplo n.º 15
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()        
Exemplo n.º 16
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     if args.get('script'):
         self.script = args.get('script')
Exemplo n.º 17
0
 def destruct(self):
     Model.destruct(self)
     for item in self.item_types.values():
         item.destruct()
     self.item_types.clear()
Exemplo n.º 18
0
 def __init__(self, args={}):
     self.item_types = {}
     Model.__init__(self, args)
     if not self.keywords and self.name:
         self.keywords = self.name.lower().split()
Exemplo n.º 19
0
 def destruct(self):
     Model.destruct(self)
     for item in self.item_types.values():
         item.destruct()
     self.item_types.clear()
Exemplo n.º 20
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     if args.get('script'):
         self.script = args.get('script')
Exemplo n.º 21
0
 def __init__(self, args={}):
     self.item_types = {}
     Model.__init__(self, args)
     if not self.keywords and self.name:
         self.keywords = self.name.lower().split()
Exemplo n.º 22
0
 def __init__(self, args={}):
     Model.__init__(self, args)
     self.spawn_object = args.get('obj')
     self.nested_spawns = []