Example #1
0
    def announceGenerate(self):
        npcName = self.getEntityValue("name")
        if len(npcName) == 0:
            npcId = self.getEntityValueInt("npcId")
        else:
            npcId = NPCGlobals.getNPCIDByName(npcName)

        name = NPCGlobals.NPCToonDict[npcId][1]
        dna = NPCGlobals.NPCToonDict[npcId][2]
        self.b_setName(name)
        self.b_setDNAStrand(dna)
        self.b_setHealth(self.getMaxHealth())

        self.setPos(self.cEntity.getOrigin())
        self.setHpr(self.cEntity.getAngles())

        DistributedEntityAI.announceGenerate(self)
        DistributedToonAI.announceGenerate(self)

        #self.b_setParent(CIGlobals.SPRender)
        self.startPosHprBroadcast()

        self.startAI()

        self.accept(self.getHealthChangeEvent(), self.__hpChange)
 def announceGenerate(self):
     DistributedToonAI.announceGenerate(self)
     if self.parentId != self.getDefaultShard():
         self.b_setDefaultShard(self.parentId)
Example #3
0
 def announceGenerate(self):
     DistributedToonAI.announceGenerate(self)
     taskMgr.add(self.__hpRegenTask, self.taskName("hpRegen"))