Пример #1
0
 def announceGenerate(self):
     DistributedSuitAI.announceGenerate(self)
     self.stopAI()
     self.b_setParent(CIGlobals.SPRender)
     self.startPosHprBroadcast()
     taskMgr.add(self.monitorHealth, self.uniqueName('monitorHealth'))
     self.setState('guard')
    def announceGenerate(self):
        entnum = self.cEntity.getBspEntnum()
        suitId = self.getEntityValueInt("suitPlan")
        suitPlan = SuitBank.getSuitById(suitId)
        level = self.getEntityValueInt("level")
        variant = self.getEntityValueInt("variant")
        self.b_setLevel(level)
        self.b_setSuit(suitPlan, variant)
        self.b_setPlace(self.zoneId)
        self.b_setName(suitPlan.getName())

        self.setPos(self.cEntity.getOrigin())
        self.setHpr(self.cEntity.getAngles())
        pos = self.getPos()
        hpr = self.getHpr()
        self.d_setPosHpr(pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2])

        DistributedEntityAI.announceGenerate(self)
        DistributedSuitAI.announceGenerate(self)
        self.stopAI()

        self.b_setParent(CIGlobals.SPRender)
        taskMgr.add(self.monitorHealth, self.uniqueName('monitorHealth'))
        self.startPosHprBroadcast()

        spawnflags = self.getEntityValueInt("spawnflags")
        if spawnflags & self.StartsActive:
            self.Activate()
Пример #3
0
    def announceGenerate(self):
        entnum = self.cEntity.getBspEntnum()
        suitId = self.getEntityValueInt("suitPlan")
        suitPlan = SuitBank.getSuitById(suitId)
        level = self.getEntityValueInt("level")
        variant = self.getEntityValueInt("variant")
        self.b_setLevel(level)
        self.b_setSuit(suitPlan, variant)
        self.b_setPlace(self.zoneId)
        self.b_setName(suitPlan.getName())
        
        attackNames = self.getEntityValue("attacklist")
        if len(attackNames) > 0:
            attackNames = attackNames.split(';')
            attackIds = []
            for name in attackNames:
                attackIds.append(AttackEnum[name])
            self.b_setAttackIds(attackIds)
            
        #hp = self.getEntityValueInt("health")
        #if hp != -1:
        #    self.b_setMaxHealth(hp)
        #    self.b_setHealth(hp)
        
        self.setPos(self.cEntity.getOrigin())
        self.setHpr(self.cEntity.getAngles())
        pos = self.getPos()
        hpr = self.getHpr()
        self.d_setPosHpr(pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2])
        
        DistributedSuitAI.announceGenerate(self)
        self.stopAI()

        #self.b_setParent(CIGlobals.SPRender)
        taskMgr.add(self.monitorHealth, self.uniqueName('monitorHealth'))
        self.startPosHprBroadcast()
        
        if self.spawnflags & self.StartsActive:
            self.Activate()