Exemplo n.º 1
0
	def onTimer(self, tid, userArg):
		"""
		KBEngine method.
		引擎回调timer触发
		"""
		#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
		NPCObject.onTimer(self, tid, userArg)
Exemplo n.º 2
0
    def onTimer(self, tid, userArg):
        """
		Ouroboros method.
		Engine callback timer trigger
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
        NPCObject.onTimer(self, tid, userArg)
Exemplo n.º 3
0
Arquivo: NPC.py Projeto: hafewa/tank-1
    def onTimer(self, tid, userArg):
        """
		KBEngine method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
        NPCObject.onTimer(self, tid, userArg)
Exemplo n.º 4
0
    def onTimer(self, tid, userArg):
        """
		shyloo method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
        NPCObject.onTimer(self, tid, userArg)
        Spell.onTimer(self, tid, userArg)
        AI.onTimer(self, tid, userArg)
Exemplo n.º 5
0
    def onTimer(self, tid, userArg):
        """
		KBEngine method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.className, self.id, tid, userArg))
        NPCObject.onTimer(self, tid, userArg)
        Spell.onTimer(self, tid, userArg)
        AI.onTimer(self, tid, userArg)
Exemplo n.º 6
0
	def onTimer(self, tid, userArg):
		"""
		KBEngine method.
		引擎回调timer触发
		"""
		#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
		NPCObject.onTimer(self, tid, userArg)

		if SCDefine.TIMER_TYPE_HEARDBEAT == userArg:
			#DEBUG_MSG("[CellApp] %s::onTimer: %i, position:(%f,%f,%f), velocity(%f, %f, %f)" % (self.getScriptName(), self.id, self.position.x, self.position.y, self.position.z, self.velocity.x, self.velocity.y, self.velocity.z))

			if self.velocity != Math.Vector3(0,0,0):
				#movePosition = Math.Vector3(self.velocity.x * deltaTime, self.velocity.y * deltaTime, self.velocity.z * deltaTime)
				movePosition = self.velocity * deltaTime
				self.position = self.position + movePosition

				self.velocity.y = self.velocity.y + (-gravity * deltaTime)

			if self.position.y < 0:
				self.delTimer(tid)
				self.destroy()