def enter(self):
     SuitHabitualBehavior.enter(self)
     self.__toggleBackupAvailable()
     self.backupLevel += 1
     backupCooldown = random.randint(16, 20)
     self.backupCooldown = Sequence(Wait(backupCooldown), Func(self.__toggleBackupAvailable))
     taskMgr.doMethodLater(6, self.__spawnBackupGroup, self.suit.uniqueName('Spawn Backup Group'))
     self.suit.getManager().sendSysMessage('%s is calling in backup!' % self.suit.getName())
     self.exit()
 def enter(self):
     SuitHabitualBehavior.enter(self)
     self.accept(self.suit.healthChangeEvent, self.__healthChange)
     pathKeys = CIGlobals.SuitSpawnPoints[self.suit.getHood()].keys()
     pathKey = random.choice(pathKeys)
     endIndex = pathKeys.index(pathKey)
     if not self.suit.getCurrentPath():
         startIndex = -1
     else:
         startIndex = pathKeys.index(self.suit.getCurrentPath())
     self.suit.setCurrentPath(pathKey)
     self.suit.b_setSuitState(0, startIndex, endIndex)
     Sequence(Wait(0.5), Func(self.flyToNewSpot, pathKey)).start()
示例#3
0
 def enter(self):
     SuitHabitualBehavior.enter(self)
     if not hasattr(self, 'suit') or not self.suit or self.suit.isEmpty():
         self.exit()
         return
     self.accept(self.suit.healthChangeEvent, self.__healthChange)
     pathKeys = CIGlobals.SuitSpawnPoints[self.suit.getHood()].keys()
     pathKey = random.choice(pathKeys)
     endIndex = pathKeys.index(pathKey)
     if not self.suit.getCurrentPath():
         startIndex = -1
     else:
         startIndex = pathKeys.index(self.suit.getCurrentPath())
     self.suit.setCurrentPath(pathKey)
     self.suit.b_setSuitState(0, startIndex, endIndex)
     Sequence(Wait(0.5), Func(self.flyToNewSpot, pathKey)).start()
示例#4
0
 def enter(self):
     SuitHabitualBehavior.enter(self)
     self.__toggleCanHeal()
     attack = random.randint(0, 6)
     attackName = SuitAttacks.SuitAttackLengths.keys()[attack]
     timestamp = globalClockDelta.getFrameNetworkTime()
     self.suit.sendUpdate('doAttack', [attack, self.boss.doId, timestamp])
     distance = self.suit.getDistance(self.boss)
     timeUntilHeal = distance / self.HEAL_SPEED
     timeUntilRelease = 1.0
     self.suit.d_setChat(CIGlobals.SuitHealTaunt)
     hp = random.randint(self.minHeal, self.maxHeal)
     if self.boss.getHealth() + hp > self.boss.getMaxHealth():
         hp = self.boss.getMaxHealth() - self.boss.getHealth()
     if attackName != 'glowerpower':
         if self.suit.suitPlan.getSuitType() == 'C':
             timeUntilRelease = 2.2
         else:
             timeUntilRelease = 3.0
     self.suitHealTrack = Sequence(Func(self.__disableBoss), Wait(timeUntilRelease + timeUntilHeal), Func(self.__attemptToHealBoss, hp), Func(self.__enableBoss), Func(self.exit))
     self.suitHealTrack.start()
示例#5
0
 def enter(self):
     SuitHabitualBehavior.enter(self)
     self.origHealth = self.suit.getHealth()
     self.attacksThisSession = 0
     self.startAttacking()