doomsday: Add an "AskAgain" state to suits in case they run out of orders
This commit is contained in:
parent
7b0ff91bdf
commit
25b2aa94ba
2 changed files with 13 additions and 1 deletions
|
@ -37,7 +37,8 @@ class InvasionMasterAI:
|
|||
toonId = random.choice(attackables).doId
|
||||
brain.demand('Attack', toonId)
|
||||
else:
|
||||
pass # Below state not implemented yet.
|
||||
brain.demand('AskAgain')
|
||||
# Below state not implemented yet.
|
||||
#brain.demand('Wander')
|
||||
|
||||
def toonUnreachable(self, toonId):
|
||||
|
|
|
@ -278,6 +278,17 @@ class InvasionSuitBrainAI(FSM):
|
|||
self.suit.idle()
|
||||
self.master.requestOrders(self)
|
||||
|
||||
def enterAskAgain(self):
|
||||
# Brain has absolutely nothing to do. Let's ask the master again in a few seconds in case any toons become available.
|
||||
self.suit.idle()
|
||||
self._askDelay = \
|
||||
taskMgr.doMethodLater(10.0, self.demand,
|
||||
self.suit.uniqueName('askingAgain'),
|
||||
extraArgs=['Idle'])
|
||||
|
||||
def exitAskAgain(self):
|
||||
self._askDelay.remove()
|
||||
|
||||
def enterAttack(self, toonId):
|
||||
self.behavior = AttackBehavior(self, toonId)
|
||||
self.behavior.start()
|
||||
|
|
Loading…
Reference in a new issue