def autoclimb(self): '''自动爬塔 ''' if self.high <=1 or self.nowLayers !=1: return {'result':False,'message':Lg().g(501)} boundmsglist = [] for layer in range(1,self.high): bounds = self.doTowerBound(layer)#进行胜利后的奖励处理 self.nowLayers = layer+1 exp = bounds.get('exp') item = bounds.get('item') msg = '' if exp: boundmsglist.append(Lg().g(502)%(layer,exp)) if item: boundmsglist.append(Lg().g(503)%(layer,item.baseInfo.getName())) boundmsglist.append(msg) props = {} props['nowLayers'] = self.nowLayers characterId = self._owner.baseInfo.id dbtower.updateCharacterTowerRecord(characterId, props) return {'result':True,'data':boundmsglist}
def succedHandle(self): '''爬塔成功后的处理 ''' props = {} self.nowLayers +=1 if self.high < self.nowLayers: self.high = self.nowLayers props['high'] = self.nowLayers props['nowLayers'] = self.nowLayers characterId = self._owner.baseInfo.id dbtower.updateCharacterTowerRecord(characterId, props)
def succedHandle(self): '''爬塔成功后的处理 ''' props = {} self.nowLayers += 1 if self.high < self.nowLayers: self.high = self.nowLayers props['high'] = self.nowLayers props['nowLayers'] = self.nowLayers characterId = self._owner.baseInfo.id dbtower.updateCharacterTowerRecord(characterId, props)
def resetTowerRecord(self): '''重置角色的爬塔记录 ''' self.climbtimes = 0 self.nowLayers = 1 characterId = self._owner.baseInfo.id nowdate = datetime.date.today() self.climbtimes = 0 self.nowLayers = 1 self.recordDate = nowdate props = {'climbtimes':0,'nowLayers':1,'recordDate':str(nowdate)} dbtower.updateCharacterTowerRecord(characterId, props)
def resetTowerRecord(self): '''重置角色的爬塔记录 ''' self.climbtimes = 0 self.nowLayers = 1 characterId = self._owner.baseInfo.id nowdate = datetime.date.today() self.climbtimes = 0 self.nowLayers = 1 self.recordDate = nowdate props = {'climbtimes': 0, 'nowLayers': 1, 'recordDate': str(nowdate)} dbtower.updateCharacterTowerRecord(characterId, props)
def flushTowerRecord(self): '''刷新爬塔记录 ''' if self.nowLayers ==1: return {'result':False,'message':Lg().g(493)} viplevel = self._owner.baseInfo._viptype if not dbVIP.vipCertification('climbtimes', viplevel,nowtimes= self.climbtimes): return {'result':False,'message':Lg().g(494)} goldcons = FLUSH_CONS.get(self.climbtimes+1) if goldcons and goldcons> self._owner.finance.getGold():#判断消耗 return {'result':False,'message':Lg().g(190)} else: self._owner.finance.consGold(goldcons,12, consDesc=u'刷新克洛塔消耗%d钻'%goldcons)#刷新克洛塔#(-goldcons)#扣除消耗的钻 self.climbtimes +=1 self.nowLayers = 1 characterId = self._owner.baseInfo.id props = {'climbtimes':self.climbtimes,'nowLayers':1} dbtower.updateCharacterTowerRecord(characterId, props) return {'result':True,'message':Lg().g(495)}
def flushTowerRecord(self): '''刷新爬塔记录 ''' if self.nowLayers == 1: return {'result': False, 'message': Lg().g(493)} viplevel = self._owner.baseInfo._viptype if not dbVIP.vipCertification( 'climbtimes', viplevel, nowtimes=self.climbtimes): return {'result': False, 'message': Lg().g(494)} goldcons = FLUSH_CONS.get(self.climbtimes + 1) if goldcons and goldcons > self._owner.finance.getGold(): #判断消耗 return {'result': False, 'message': Lg().g(190)} else: self._owner.finance.consGold(goldcons, 12, consDesc=u'刷新克洛塔消耗%d钻' % goldcons) #刷新克洛塔#(-goldcons)#扣除消耗的钻 self.climbtimes += 1 self.nowLayers = 1 characterId = self._owner.baseInfo.id props = {'climbtimes': self.climbtimes, 'nowLayers': 1} dbtower.updateCharacterTowerRecord(characterId, props) return {'result': True, 'message': Lg().g(495)}
def autoclimb(self): '''自动爬塔 ''' if self.high <= 1 or self.nowLayers != 1: return {'result': False, 'message': Lg().g(501)} boundmsglist = [] for layer in range(1, self.high): bounds = self.doTowerBound(layer) #进行胜利后的奖励处理 self.nowLayers = layer + 1 exp = bounds.get('exp') item = bounds.get('item') msg = '' if exp: boundmsglist.append(Lg().g(502) % (layer, exp)) if item: boundmsglist.append(Lg().g(503) % (layer, item.baseInfo.getName())) boundmsglist.append(msg) props = {} props['nowLayers'] = self.nowLayers characterId = self._owner.baseInfo.id dbtower.updateCharacterTowerRecord(characterId, props) return {'result': True, 'data': boundmsglist}