Beispiel #1
0
 def add(self,pid):
     '''添加或者修改强化冷却时间
     @param counts: int 冷却秒数
     '''
     import datetime,time
     ctime=datetime.datetime.fromtimestamp(time.time())
     ss=self.getByPid(pid)#强化剩余冷却时间
     if self.qhtime.has_key(pid):
         self.qhtime.get(pid)['counts']=ss+configure.m(5)
         self.qhtime.get(pid)['ctime']=ctime
         dbStrengthenicon.update(pid, ctime, self.qhtime.get(pid)['counts'])
     else:
         self.qhtime[pid]={"pid":pid,"ctime":ctime,"counts":configure.m(5)}
         dbStrengthenicon.add(pid, ctime, configure.m(5))
Beispiel #2
0
 def add(self):
     '''添加或者修改商店冷去时间,返回剩余秒数
     @param counts: int 冷却秒数
     '''
     if self.ctime:
         tlist=configure.getchatimeTime(self.ctime,self.counts)
         ctime=tlist[1]#系统当前时间
         ss=tlist[0]#冷却持续时间
         if ss<1:
             self.counts=ss+configure.m(30)
             self.ctime=ctime
         return self.counts
     else:
         self.counts=configure.m(30)
         self.ctime=datetime.datetime.now()
         return self.counts
Beispiel #3
0
 def add(self, wd):
     '''添加或者修改强化冷却时间,返回剩余秒数
     @param wd: int 物品等级
     '''
     sj = int((wd + 5) * 0.5)  #增加的冷却时间(分钟)
     if self.ctime:
         tlist = configure.getchatimeTime(self.ctime, self.counts)
         ctime = tlist[1]
         ss = tlist[0]
         self.counts = ss + configure.m(sj)
         self.ctime = ctime
         pushObjectNetInterface.StrengthenTime2120(self.pid, self.getTime())
         return self.counts
     else:
         self.counts = configure.m(sj)
         self.ctime = datetime.datetime.now()
         pushObjectNetInterface.StrengthenTime2120(self.pid, self.getTime())
         return self.counts
Beispiel #4
0
 def add(self,wd):
     '''添加或者修改强化冷却时间,返回剩余秒数
     @param wd: int 物品等级
     '''
     sj=int((wd+5)*0.5)#增加的冷却时间(分钟)
     if self.ctime:
         tlist=configure.getchatimeTime(self.ctime,self.counts)
         ctime=tlist[1]
         ss=tlist[0]
         self.counts=ss+configure.m(sj)
         self.ctime=ctime
         pushObjectNetInterface.StrengthenTime2120(self.pid, self.getTime())
         return self.counts
     else:
         self.counts=configure.m(sj)
         self.ctime=datetime.datetime.now()
         pushObjectNetInterface.StrengthenTime2120(self.pid, self.getTime())
         return self.counts
Beispiel #5
0
    def suiji(self,lv,istrue=False):
        '''随机四个宠物
        @param lv: int npcid
        @param istrue: bool  默认False True:表示刷新时间
        '''
        shopall=dbCharacterPet.shopAll
        self.s4(shopall, self.shop1)

        if istrue:
            self.ctime=datetime.datetime.now() #系统当前时间
            self.counts=configure.m(30)
Beispiel #6
0
    def getZongTime(self):
        '''获取最大冷却时间'''

        viplevel = self.owner.baseInfo.getType()  #获取角色vip等级
        plevel = self.owner.level.getLevel()  #角色等级
        return configure.m(int((plevel * 0.5) + (viplevel + 1) * 20))
Beispiel #7
0
 def getZongTime(self,pid):
     '''根据角色id获取最大冷却时间'''
     from app.scense.core.PlayersManager import PlayersManager
     player=PlayersManager().getPlayerByID(pid)
     viplevel=player.baseInfo.getType()#获取角色vip等级
     return configure.m((viplevel+1)*20)
Beispiel #8
0
 def getZongTime(self):
     '''获取最大冷却时间'''
     
     viplevel=self.owner.baseInfo.getType()#获取角色vip等级
     plevel=self.owner.level.getLevel()#角色等级
     return configure.m(int((plevel*0.5)+(viplevel+1)*20))