def at_server_start(): """ This is called every time the server starts up, regardless of how it was shut down. """ # reset settings GAME_SETTINGS.reset() # reload keys OBJECT_KEY_HANDLER.reload() # reset default locations builder.reset_default_locations() # clear dialogues DIALOGUE_HANDLER.clear() # clear quest dependencies QUEST_DEP_HANDLER.clear() # reload equipment types EQUIP_TYPE_HANDLER.reload() # reload local strings LOCALIZED_STRINGS_HANDLER.reload() # localize model fields localize_model_fields()
def at_server_start(): """ This is called every time the server starts up, regardless of how it was shut down. """ # reset settings GAME_SETTINGS.reset() CLIENT_SETTINGS.reset() # reload keys OBJECT_KEY_HANDLER.reload() # reset default locations builder.reset_default_locations() # clear dialogues DIALOGUE_HANDLER.clear() # clear quest dependencies QUEST_DEP_HANDLER.clear() # reload equipment types EQUIP_TYPE_HANDLER.reload() # reload local strings LOCALIZED_STRINGS_HANDLER.reload() # localize model fields localize_model_fields()
def at_server_start(): """ This is called every time the server starts up, regardless of how it was shut down. """ # reset settings from muddery.utils.game_settings import GAME_SETTINGS GAME_SETTINGS.reset() # reload local strings from muddery.utils.localized_strings_handler import LOCALIZED_STRINGS_HANDLER LOCALIZED_STRINGS_HANDLER.reload() # reset default locations from muddery.utils import builder builder.reset_default_locations() # clear dialogues from muddery.utils.dialogue_handler import DIALOGUE_HANDLER DIALOGUE_HANDLER.clear() # reload equipment types from muddery.utils.equip_type_handler import EQUIP_TYPE_HANDLER EQUIP_TYPE_HANDLER.reload() # localize model fields from muddery.utils.localiztion_handler import localize_model_fields localize_model_fields() # load condition descriptions from muddery.utils.desc_handler import DESC_HANDLER DESC_HANDLER.reload()
def at_server_start(): """ This is called every time the server starts up, regardless of how it was shut down. """ # reload keys OBJECT_KEY_HANDLER.reload() # reset default locations builder.reset_default_locations() # clear dialogues DIALOGUE_HANDLER.clear() # clear quest dependencies QUEST_DEP_HANDLER.clear() # reload equipment types EQUIP_TYPE_HANDLER.reload() # reload local strings LOCALIZED_STRINGS_HANDLER.reload() # reload skill modules MudderySkill.load_skill_modules()
def at_server_start(): """ This is called every time the server starts up, regardless of how it was shut down. """ # reset settings from muddery.utils.game_settings import GAME_SETTINGS GAME_SETTINGS.reset() # reload local strings from muddery.utils.localized_strings_handler import LOCALIZED_STRINGS_HANDLER LOCALIZED_STRINGS_HANDLER.reload() # reload attributes from muddery.utils.attributes_info_handler import CHARACTER_ATTRIBUTES_INFO CHARACTER_ATTRIBUTES_INFO.reload() from muddery.utils.attributes_info_handler import EQUIPMENT_ATTRIBUTES_INFO EQUIPMENT_ATTRIBUTES_INFO.reload() from muddery.utils.attributes_info_handler import FOOD_ATTRIBUTES_INFO FOOD_ATTRIBUTES_INFO.reload() # reset default locations from muddery.utils import builder builder.reset_default_locations() # clear dialogues from muddery.utils.dialogue_handler import DIALOGUE_HANDLER DIALOGUE_HANDLER.clear() # reload equipment types from muddery.utils.equip_type_handler import EQUIP_TYPE_HANDLER EQUIP_TYPE_HANDLER.reload() # localize model fields from muddery.utils.localiztion_handler import localize_model_fields localize_model_fields() # set character attribute field names CHARACTER_ATTRIBUTES_INFO.set_model_fields() EQUIPMENT_ATTRIBUTES_INFO.set_model_fields() FOOD_ATTRIBUTES_INFO.set_model_fields() # load condition descriptions from muddery.utils.desc_handler import DESC_HANDLER DESC_HANDLER.reload() # load honours from muddery.dao.honours_mapper import HONOURS_MAPPER HONOURS_MAPPER.reload()
def equip_object(self, obj): """ Equip an object. """ if not obj.location == self: self.msg({"alert": "You do not have that equipment."}) return False type = obj.type position = obj.position career = "" if not EQUIP_TYPE_HANDLER.can_equip(type, career): self.msg({"alert": "Can not equip that equipment."}) return False # take off old equipment if self.db.equipments[position]: dbref = self.db.equipments[position] for content in self.contents: if content.dbref == dbref: content.equipped = False # put on new equipment self.db.equipments[position] = obj.dbref obj.equipped = True # reset character's attributes self.refresh_data() return True
def equip_object(self, obj): """ Equip an object. """ if not obj.location == self: self.msg({"alert":"You do not have that equipment."}) return type = obj.type position = obj.position career = "" if not EQUIP_TYPE_HANDLER.can_equip(type, career): self.msg({"alert":"Can not equip that equipment."}) return # take off old equipment if self.db.equipments[position]: dbref = self.db.equipments[position] for content in self.contents: if content.dbref == dbref: content.equipped = False # put on new equipment self.db.equipments[position] = obj.dbref obj.equipped = True # reset character's attributes self.refresh_data()
def at_server_start(): """ This is called every time the server starts up, regardless of how it was shut down. """ # reset settings GAME_SETTINGS.reset() # reload keys OBJECT_KEY_HANDLER.reload() # reload attributes CHARACTER_ATTRIBUTES_INFO.reload() EQUIPMENT_ATTRIBUTES_INFO.reload() FOOD_ATTRIBUTES_INFO.reload() # reset default locations builder.reset_default_locations() # clear dialogues DIALOGUE_HANDLER.clear() # clear quest dependencies QUEST_DEP_HANDLER.clear() # reload equipment types EQUIP_TYPE_HANDLER.reload() # reload local strings LOCALIZED_STRINGS_HANDLER.reload() # localize model fields localize_model_fields() # set character attribute field names CHARACTER_ATTRIBUTES_INFO.set_model_fields() EQUIPMENT_ATTRIBUTES_INFO.set_model_fields() FOOD_ATTRIBUTES_INFO.set_model_fields() # load condition descriptions DESC_HANDLER.reload() # load honours HONOURS_MAPPER.reload()
def equip_object(self, obj): """ Equip an object. args: obj(object): the equipment object. """ if obj.location != self: raise MudderyError(LS("Can not find this equipment.")) type = obj.type position = obj.position career = "" if not position in settings.EQUIP_POSITIONS: raise MudderyError(LS("Can not equip it on this position.")) if not EQUIP_TYPE_HANDLER.can_equip(type, career): raise MudderyError(LS("Can not use this equipment.")) # Take off old equipment if position in self.db.equipments: if self.db.equipments[position]: dbref = self.db.equipments[position] for content in self.contents: if content.dbref == dbref: content.equipped = False # Put on new equipment, store object's dbref. self.db.equipments[position] = obj.dbref # Set object's attribute 'equipped' to True obj.equipped = True # reset character's attributes self.refresh_data() message = { "status": self.return_status(), "equipments": self.return_equipments(), "inventory": self.return_inventory(), } self.msg(message) return
def equip_object(self, obj): """ Equip an object. args: obj(object): the equipment object. """ if obj.location != self: raise MudderyError(_("Can not find this equipment.")) type = obj.type position = obj.position if position not in self.db.equipments: raise MudderyError(_("Can not equip it on this position.")) if not EQUIP_TYPE_HANDLER.can_equip(self.db.career, type): raise MudderyError(_("Can not use this equipment.")) # Take off old equipment if self.db.equipments[position]: dbref = self.db.equipments[position] for content in self.contents: if content.dbref == dbref: content.equipped = False # Put on new equipment, store object's dbref. self.db.equipments[position] = obj.dbref # Set object's attribute 'equipped' to True obj.equipped = True # reset character's attributes self.refresh_properties() message = { "status": self.return_status(), "equipments": self.return_equipments(), "inventory": self.return_inventory() } self.msg(message) return