def enter(self):
     SuitPathBehavior.enter(self)
     self.closestToon = self.getClosestToon()
     if self.suit.getDistance(
             self.closestToon) <= self.RUNAWAY_SAFE_DISTANCE:
         self.createPath(durationFactor=self.RUNAWAY_SPEED, fromCurPos=True)
         self.isPanicked = True
 def __walkDone(self):
     SuitPathBehavior.__walkDone(self)
     if self.suit.getDistance(
             self.closestToon) >= self.RUNAWAY_SAFE_DISTANCE:
         self.exit()
     else:
         self.createPath(durationFactor=self.RUNAWAY_SPEED, fromCurPos=True)
Beispiel #3
0
 def enter(self):
     SuitPathBehavior.enter(self)
     self.pickTarget()
     # Choose a distance that is good enough to attack this target.
     self.attackSafeDistance = random.uniform(5.0, 19.0)
     # Now, chase them down!
     self.fsm.request('pursue')
 def exit(self):
     SuitPathBehavior.exit(self)
     self.toonsInRange = []
     self.isPanicked = False
     self.closestToon = None
     self.resetMaxPanicTime()
     return
Beispiel #5
0
 def exit(self):
     SuitPathBehavior.exit(self)
     self.toonsInRange = []
     self.isPanicked = False
     self.closestToon = None
     self.resetMaxPanicTime()
     return
Beispiel #6
0
 def unload(self):
     SuitPathBehavior.unload(self)
     del self.boss
     del self.followBossTaskName
     del self.bossSpotKey
     del self.fsm
     del self.suitHealTrack
     del self.healInProgress
Beispiel #7
0
 def unload(self):
     SuitPathBehavior.unload(self)
     self.toonsInRange = []
     del self.toonsInRange
     del self.isPanicked
     del self.closestToon
     del self.runAwayTaskName
     del self.tickPanicTaskName
     del self.panicHealthPerct
     del self.maxPanicTime
     del self.panicTime
Beispiel #8
0
 def __init__(self, suit):
     SuitPathBehavior.__init__(self, suit, exitOnWalkFinish=False)
     self.toonsInRange = []
     self.isPanicked = False
     self.closestToon = None
     self.runAwayTaskName = self.suit.uniqueName('runAway')
     self.tickPanicTaskName = self.suit.uniqueName('tickPanic')
     self.panicHealthPerct = 0.35
     self.maxPanicTime = None
     self.panicTime = 0
     self.resetMaxPanicTime()
 def unload(self):
     SuitPathBehavior.unload(self)
     self.toonsInRange = []
     del self.toonsInRange
     del self.isPanicked
     del self.closestToon
     del self.runAwayTaskName
     del self.tickPanicTaskName
     del self.panicHealthPerct
     del self.maxPanicTime
     del self.panicTime
Beispiel #10
0
 def __init__(self, suit):
     SuitPathBehavior.__init__(self, suit, exitOnWalkFinish=False)
     self.toonsInRange = []
     self.isPanicked = False
     self.closestToon = None
     self.runAwayTaskName = self.suit.uniqueName('runAway')
     self.tickPanicTaskName = self.suit.uniqueName('tickPanic')
     self.panicHealthPerct = 0.35
     self.maxPanicTime = None
     self.panicTime = 0
     self.resetMaxPanicTime()
     return
Beispiel #11
0
 def __init__(self, suit, boss):
     SuitPathBehavior.__init__(self, suit, exitOnWalkFinish = False)
     self.fsm = ClassicFSM.ClassicFSM('SuitFollowBossBehavior', [State.State('off', self.enterOff, self.exitOff),
      State.State('follow', self.enterFollow, self.exitFollow),
      State.State('protect', self.enterProtect, self.exitProtect)], 'off', 'off')
     self.fsm.enterInitialState()
     self.boss = boss
     self.bossSpotKey = None
     self.healInProgress = False
     self.suitHealTrack = None
     self.followBossTaskName = self.suit.uniqueName('followBoss')
     self.pathFinder = SuitPathDataAI.getPathFinder(self.suit.hood)
 def unload(self):
     SuitPathBehavior.unload(self)
     del self.boss
     del self.followBossTaskName
 def enter(self):
     SuitPathBehavior.enter(self)
     self.createPath(fromCurPos=True)
 def enter(self):
     SuitPathBehavior.enter(self)
     self.__updatePath()
     taskMgr.add(self.__followBoss, self.followBossTaskName)
 def exit(self):
     SuitPathBehavior.exit(self)
     taskMgr.remove(self.followBossTaskName)
 def __init__(self, suit):
     SuitPathBehavior.__init__(self, suit)
     self.isEntered = 0
 def __init__(self, suit, boss):
     SuitPathBehavior.__init__(self, suit, exitOnWalkFinish=False)
     self.boss = boss
     self.followBossTaskName = self.suit.uniqueName('followBoss')
 def enter(self):
     SuitPathBehavior.enter(self)
     self.createPath()
 def enter(self):
     SuitPathBehavior.enter(self)
     self.createPath(fromCurPos=True)
Beispiel #20
0
 def enter(self):
     SuitPathBehavior.enter(self)
     self.closestToon = self.getClosestToon()
     if self.suit.getDistance(self.closestToon) <= self.RUNAWAY_SAFE_DISTANCE:
         self.createPath(durationFactor=self.RUNAWAY_SPEED, fromCurPos=True)
         self.isPanicked = True
 def unload(self):
     del self.spot
     SuitPathBehavior.unload(self)
Beispiel #22
0
    def enter(self):
        SuitPathBehavior.enter(self)

        # Let's start following the boss.
        self.fsm.request('follow')
Beispiel #23
0
 def enter(self):
     SuitPathBehavior.enter(self)
     self.fsm.request('follow')
Beispiel #24
0
 def __walkDone(self):
     SuitPathBehavior.__walkDone(self)
     if self.suit.getDistance(self.closestToon) >= self.RUNAWAY_SAFE_DISTANCE:
         self.exit()
     else:
         self.createPath(durationFactor=self.RUNAWAY_SPEED, fromCurPos=True)
Beispiel #25
0
 def exit(self):
     SuitPathBehavior.exit(self)
     self.fsm.requestFinalState()
     taskMgr.remove(self.followBossTaskName)
 def __init__(self, suit, spot):
     SuitPathBehavior.__init__(self, suit)
     self.spot = spot
 def enter(self):
     SuitPathBehavior.enter(self)
     self.pickTarget()
     self.attackSafeDistance = random.uniform(5.0, 19.0)
     self.fsm.request('pursue')
 def __init__(self, suit):
     SuitPathBehavior.__init__(self, suit)
     self.isEntered = 0