def op_room(type, name, value): if type == 1: room = OPdata.get_room_data() return room[name] elif type == 2: return update_room(name,value) else: error_deal("op_bag", "illegal input")
def op_room(type, name, value): if type == 1: room = OPdata.get_room_data() return room[name] elif type == 2: return update_room(name, value) else: error_deal("op_bag", "illegal input")
def op_room(type, name, value): if type == 1: room = OPdata.get_room_data() return room[name] elif type == 2: return update_room(name,value) else: print "Worng!" exit(0)
def op_room(type, name, value): if type == 1: room = OPdata.get_room_data() return room[name] elif type == 2: return update_room(name, value) else: print "Worng!" exit(0)
def op_global_data(typeNo,m_data,c_data): if typeNo == 1: if c_data == None: return OPdata.get_playerName_data() else: OPdata.update_playerName_data(c_data) return c_data elif typeNo == 2: if c_data == None: bag = OPdata.get_bag_data() return bag[m_data] else: return update_bag(m_data,c_data) elif typeNo == 3: if c_data == None: room = OPdata.get_room_data() return room[m_data] else: return update_room(m_data,c_data) else: print "get_global_data() typeNO is wrong." exit(0)
def update_room(name, value): room = OPdata.get_room_data() room[name] = room[name] - value OPdata.update_room_data(room) return room[name]
def update_room(equip_name, equip_count): room = OPdata.get_room_data() room[equip_name] = room[equip_name] - equip_count OPdata.update_room_data(room) return room[equip_name]