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')
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)
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
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()
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()
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)
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)
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()
def __init__(self, args={}): Model.__init__(self, args) if args.get('script'): self.script = args.get('script')
def destruct(self): Model.destruct(self) for item in self.item_types.values(): item.destruct() self.item_types.clear()
def __init__(self, args={}): self.item_types = {} Model.__init__(self, args) if not self.keywords and self.name: self.keywords = self.name.lower().split()
def __init__(self, args={}): Model.__init__(self, args) self.spawn_object = args.get('obj') self.nested_spawns = []