Exemple #1
0
    def _addGoalsReAvatar(self, avId):
        # add goals that have to do with a particular avatar
        av = self.pet.air.doId2do.get(avId)
        """assert av is not None, (
            '%s._addGoalsReAvatar: %s not in doId2do' % (self.pet.doId, avId))
            """
        if av is None:
            PetBrain.notify.warning('%s._addGoalsReAvatar: %s not in doId2do' %
                                    (self.pet.doId, avId))
            return

        # add goals related to this avatar
        if avId not in self.doId2goals:
            goals = [
                PetGoal.ChaseAvatar(av),
                PetGoal.FleeFromAvatar(av),
            ]
            """
            if isinstance(av, DistributedToonAI.DistributedToonAI):
                goals += [
                    ]
                    """
            self.doId2goals[avId] = goals
            self.lastInteractTime.setdefault(avId, 0)

        for goal in self.doId2goals[avId]:
            self.goalMgr.addGoal(goal)
 def _addGoalsReAvatar(self, avId):
     av = self.pet.air.doId2do.get(avId)
     if av is None:
         PetBrain.notify.warning('%s._addGoalsReAvatar: %s not in doId2do' %
                                 (self.pet.doId, avId))
         return
     if avId not in self.doId2goals:
         goals = [PetGoal.ChaseAvatar(av), PetGoal.FleeFromAvatar(av)]
         self.doId2goals[avId] = goals
         self.lastInteractTime.setdefault(avId, 0)
     for goal in self.doId2goals[avId]:
         self.goalMgr.addGoal(goal)