def requestBattle(self, x, y, z, h, p, r): toonId = self.air.getAvatarIdFromSender() if self.air.doId2do.get(toonId) == None: return if self.pathState == 3: pass elif self.pathState != 1: if self.notify.getDebug(): self.notify.debug('requestBattle() - suit %s not on path' % self.getDoId()) if self.pathState == 2 or self.pathState == 4: self.b_setBrushOff(SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId) return elif self.legType != SuitLeg.TWalk: if self.notify.getDebug(): self.notify.debug('requestBattle() - suit %s not in Bellicose' % self.getDoId()) self.b_setBrushOff(SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId) return self.confrontPos = Point3(x, y, z) self.confrontHpr = Vec3(h, p, r) if self.sp.requestBattle(self.zoneId, self, toonId): if self.notify.getDebug(): self.notify.debug('Suit %s requesting battle in zone %s' % (self.getDoId(), self.zoneId)) else: if self.notify.getDebug(): self.notify.debug('requestBattle from suit %s - denied by battle manager' % self.getDoId()) self.b_setBrushOff(SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId) return
def requestBattle(self, x, y, z, h, p, r): toonId = self.air.getAvatarIdFromSender() if self.notify.getDebug(): self.notify.debug('requestBattle() - Toon %s requesting battle at (%s, %s, %s, %s, %s, %s)' % (toonId, x, y, z, h, p, r)) if self.air.doId2do.get(toonId) == None: return if self.pathState == 3: pass elif self.pathState != 1: if self.notify.getDebug(): self.notify.debug('requestBattle() - suit %s not on path' % self.getDoId()) if self.pathState == 2 or self.pathState == 4: self.b_setBrushOff(SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId) return elif self.legType != SuitLeg.TWalk: if self.notify.getDebug(): self.notify.debug('requestBattle() - suit %s not in Bellicose' % self.getDoId()) self.b_setBrushOff(SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId) return self.confrontPos = Point3(x, y, z) self.confrontHpr = Vec3(h, p, r) if self.sp.requestBattle(self.zoneId, self, toonId): if self.notify.getDebug(): self.notify.debug('Suit %s requesting battle in zone %s' % (self.getDoId(), self.zoneId)) else: if self.notify.getDebug(): self.notify.debug('requestBattle from suit %s - denied by battle manager' % self.getDoId()) self.b_setBrushOff(SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId)
def requestBattle(self, x, y, z, h, p, r): """requestBattle(x, y, z, h, p, r) """ toonId = self.air.getAvatarIdFromSender() if self.air.doId2do.get(toonId) == None: # Ignore requests from unknown toons. return assert self.notify.debug("%s: request battle with toon %s in zone %s" % (self.doId, toonId, self.zoneId)) # First make sure we're in Bellicose mode (i.e. on a Bellicose leg) if self.pathState == 3: # We are in tutorialbellicose. No brushoff needed. pass elif self.pathState != 1: # We're not even in path mode. We must be in a battle already. if self.notify.getDebug(): self.notify.debug('requestBattle() - suit %d not on path' % (self.getDoId())) if self.pathState == 2 or self.pathState == 4: # Or flying away. self.b_setBrushOff( SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId) return elif self.legType != SuitLeg.TWalk: # We're on a path, but not in bellicose mode. We're # probably walking to or from a building. if self.notify.getDebug(): self.notify.debug( 'requestBattle() - suit %d not in Bellicose' % (self.getDoId())) self.b_setBrushOff(SuitDialog.getBrushOffIndex( self.getStyleName())) self.d_denyBattle(toonId) return # Store the suit's actual pos and hpr on the client self.confrontPos = Point3(x, y, z) self.confrontHpr = Vec3(h, p, r) # Request a battle from the suit planner if (self.sp.requestBattle(self.zoneId, self, toonId)): if self.notify.getDebug(): self.notify.debug("Suit %d requesting battle in zone %d" % (self.getDoId(), self.zoneId)) else: # Suit tells toon to get lost if self.notify.getDebug(): self.notify.debug( 'requestBattle from suit %d - denied by battle manager' % (self.getDoId())) self.b_setBrushOff(SuitDialog.getBrushOffIndex( self.getStyleName())) self.d_denyBattle(toonId)
def requestBattle(self, x, y, z, h, p, r): """requestBattle(x, y, z, h, p, r) """ toonId = self.air.getAvatarIdFromSender() if self.notify.getDebug(): self.notify.debug(str(self.getDoId()) + \ str(self.zoneId) + \ ': request battle with toon: %d' % toonId) # Store the suit's actual pos and hpr on the client self.confrontPos = Point3(x, y, z) self.confrontHpr = Vec3(h, p, r) # Request a battle from the suit planner if (self.sp.requestBattle(self, toonId)): if self.notify.getDebug(): self.notify.debug( "Suit %d requesting battle in zone %d with toon %d" % (self.getDoId(), self.zoneId, toonId)) else: # Suit tells toon to get lost if self.notify.getDebug(): self.notify.debug( 'requestBattle from suit %d, toon %d- denied by battle manager' % (toonId, self.getDoId())) self.b_setBrushOff(SuitDialog.getBrushOffIndex( self.getStyleName())) self.d_denyBattle(toonId)
def requestBattle(self, x, y, z, h, p, r): toonId = self.air.getAvatarIdFromSender() if self.notify.getDebug(): self.notify.debug(str(self.getDoId()) + str(self.zoneId) + ': request battle with toon: %d' % toonId) self.confrontPos = Point3(x, y, z) self.confrontHpr = Vec3(h, p, r) if self.sp.requestBattle(self, toonId): if self.notify.getDebug(): self.notify.debug('Suit %d requesting battle in zone %d with toon %d' % (self.getDoId(), self.zoneId, toonId)) else: if self.notify.getDebug(): self.notify.debug('requestBattle from suit %d, toon %d- denied by battle manager' % (toonId, self.getDoId())) self.b_setBrushOff(SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId)
def requestBattle(self, x, y, z, h, p, r): toonId = self.air.getAvatarIdFromSender() if self.notify.getDebug(): self.notify.debug(str(self.getDoId()) + str(self.zoneId) + ': request battle with toon: %d' % toonId) self.confrontPos = Point3(x, y, z) self.confrontHpr = Vec3(h, p, r) if self.sp.requestBattle(self, toonId): if self.notify.getDebug(): self.notify.debug('Suit %d requesting battle in zone %d with toon %d' % (self.getDoId(), self.zoneId, toonId)) elif self.notify.getDebug(): self.notify.debug('requestBattle from suit %d, toon %d- denied by battle manager' % (toonId, self.getDoId())) self.b_setBrushOff(SuitDialog.getBrushOffIndex(self.getStyleName())) self.d_denyBattle(toonId)
def setBrushOff(self, index): self.setChatAbsolute( SuitDialog.getBrushOffText(self.getStyleName(), index), CFSpeech | CFTimeout)
def setBrushOff(self, index): self.setChatAbsolute(SuitDialog.getBrushOffText(self.getStyleName(), index), CFSpeech | CFTimeout)