def feed(self, avatar): if avatar.takeMoney(PetConstants.FEED_AMOUNT): self.startLockPetMove(avatar.doId) self.brain.observe( PetObserve.PetActionObserve(PetObserve.Actions.FEED, avatar.doId)) self.feedLogger.addEvent()
def announceZoneChange(self, newZoneId, oldZoneId): DistributedPetAI.notify.debug('%s.announceZoneChange: %s->%s' % (self.doId, oldZoneId, newZoneId)) broadcastZones = list2dict([newZoneId, oldZoneId]) PetObserve.send( broadcastZones.keys(), PetObserve.PetActionObserve(PetObserve.Actions.CHANGE_ZONE, self.doId, (oldZoneId, newZoneId)))
def _handleLookedAtByOtherStop(self, avId): if avId not in self.lookers: PetBrain.notify.warning('%s: av %s not looking at me' % (self.pet.doId, avId)) return del self.lookers[avId] self.observe( PetObserve.PetActionObserve(PetObserve.Actions.ATTENDED_STOP, avId))
def _handleLookedAtByOtherStart(self, avId): if avId in self.lookers: PetBrain.notify.warning('%s: av %s already looking at me' % (self.pet.doId, avId)) return self.lookers[avId] = avId self.observe( PetObserve.PetActionObserve(PetObserve.Actions.ATTENDED_START, avId))
def _handleLookingAtOtherStop(self, avId): if avId not in self.lookees: PetBrain.notify.warning('%s: not looking at av %s' % (self.pet.doId, avId)) return del self.lookees[avId] self.observe( PetObserve.PetActionObserve(PetObserve.Actions.ATTENDING_STOP, avId))
def _handleLookingAtOtherStart(self, avId): if avId in self.lookees: PetBrain.notify.warning('%s: already looking at av %s' % (self.pet.doId, avId)) return self.lookees[avId] = avId self.observe( PetObserve.PetActionObserve(PetObserve.Actions.ATTENDING_START, avId))
def announceZoneChange(self, newZoneId, oldZoneId): DistributedPetAI.notify.debug('%s.announceZoneChange: %s->%s' % (self.doId, oldZoneId, newZoneId)) broadcastZones = list2dict([newZoneId, oldZoneId]) self.estateOwnerId = simbase.air.estateMgr.getOwnerFromZone(newZoneId) if self.estateOwnerId: if __dev__: pass self.inEstate = 1 self.estateZones = simbase.air.estateMgr.getEstateZones(self.estateOwnerId) else: self.inEstate = 0 self.estateZones = [] PetObserve.send(broadcastZones.keys(), PetObserve.PetActionObserve(PetObserve.Actions.CHANGE_ZONE, self.doId, (oldZoneId, newZoneId)))
def scratch(self, avatar): self.startLockPetMove(avatar.doId) self.brain.observe( PetObserve.PetActionObserve(PetObserve.Actions.SCRATCH, avatar.doId)) self.scratchLogger.addEvent()
def scratch(self, avatar): #self.startLockPetMove(avatar.doId) # Put new locking mechanism here self.brain.observe( PetObserve.PetActionObserve(PetObserve.Actions.SCRATCH, avatar.doId)) self.scratchLogger.addEvent()