예제 #1
0
 def _handleDoTrick(trickId, avId, self=self):
     avatar = simbase.air.doId2do.get(avId)
     if avatar:
         if self.lookedAtBy(avatar.doId):
             if not self.goalMgr.hasTrickGoal():
                 if not self.pet._willDoTrick(trickId):
                     self.pet.trickFailLogger.addEvent(trickId)
                     trickId = PetTricks.Tricks.BALK
                 trickGoal = PetGoal.DoTrick(avatar, trickId)
                 self.goalMgr.addGoal(trickGoal)
예제 #2
0
 def _handleDoTrick(trickId, avId, self=self):
     # av is telling us to do a trick
     avatar = simbase.air.doId2do.get(avId)
     if avatar:
         if self.lookedAtBy(avatar.doId):
             # there should only be one DoTrick goal at a time
             if not self.goalMgr.hasTrickGoal():
                 # will the pet do the trick?
                 if not self.pet._willDoTrick(trickId):
                     self.pet.trickFailLogger.addEvent(trickId)
                     trickId = PetTricks.Tricks.BALK
                 # add a goal of doing the trick
                 trickGoal = PetGoal.DoTrick(avatar, trickId)
                 self.goalMgr.addGoal(trickGoal)