Ejemplo n.º 1
0
    def setEntityState(self, state):
        DistributedEntityAI.setEntityState(self, state)

        if state == self.StateDown:
            self.stomped = False
            self.clearSequence()
            self.setPos(self.cEntity.getOrigin())
            self.dispatchOutput("OnStomp")

        elif state == self.StateUp:
            self.clearSequence()
            self.setPos(self.cEntity.getOrigin() + self.getUpPosition())
            self.dispatchOutput("OnRaise")

        elif state == self.StateStomp:
            self.damaged = []
            self.setSequence(
                LerpPosInterval(
                    self, self.height / self.stompSpeed,
                    self.cEntity.getOrigin(),
                    self.cEntity.getOrigin() + self.getUpPosition()))

        elif state == self.StateRaise:
            self.setSequence(
                LerpPosInterval(
                    self, self.height / self.raiseSpeed,
                    self.cEntity.getOrigin() + self.getUpPosition(),
                    self.cEntity.getOrigin()))
Ejemplo n.º 2
0
 def setEntityState(self, state):
     DistributedEntityAI.setEntityState(self, state)
     
     self.clearMoveTrack()
     
     if state == self.StateMoving:
         
         if (not self.startPoint) or (not self.endPoint):
             print("FuncElevatorAI ERROR: Missing either start or end point")
             return
             
         startPos = self.startPoint.cEntity.getOrigin()
         endPos = self.endPoint.cEntity.getOrigin()
         dist = (endPos - startPos).length()
         duration = (dist * 16) / self.speed
         self.moveTrack = LerpPosInterval(self, duration, endPos, startPos)
         self.moveTrack.start()
         
         self.dispatchOutput("OnStartMove")
Ejemplo n.º 3
0
 def setEntityState(self, state):
     DistributedEntityAI.setEntityState(self, state)
     if state == self.StateOpened:
         self.dispatchOutput("OnOpenCage")