New magic word: ~secondVP - skips to second battle

This commit is contained in:
John 2015-08-08 13:32:48 +03:00
parent ce8d856ebe
commit 80b5e4c548
2 changed files with 22 additions and 13 deletions

View file

@ -38,7 +38,7 @@ class DistributedCashbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM):
def __init__(self, cr):
DistributedBossCog.DistributedBossCog.__init__(self, cr)
FSM.FSM.__init__(self, 'DistributedSellbotBoss')
FSM.FSM.__init__(self, 'DistributedCashbotBoss')
self.resistanceToon = None
self.resistanceToonOnstage = 0
self.cranes = {}

View file

@ -403,18 +403,32 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
def enterReward(self):
DistributedBossCogAI.DistributedBossCogAI.enterReward(self)
def getVP(invoker):
for do in simbase.air.doId2do.values():
if isinstance(do, DistributedSellbotBossAI):
if invoker.doId in do.involvedToons:
return do
@magicWord(category=CATEGORY_ADMINISTRATOR)
def secondVP():
"""
Skips to the second round of the VP.
"""
invoker = spellbook.getInvoker()
boss = getVP(invoker)
if not boss:
return "You aren't in a VP!"
boss.exitIntroduction()
boss.b_setState('RollToBattleTwo')
return 'Skipping to the second round...'
@magicWord(category=CATEGORY_ADMINISTRATOR)
def skipVP():
"""
Skips to the final round of the VP.
"""
invoker = spellbook.getInvoker()
boss = None
for do in simbase.air.doId2do.values():
if isinstance(do, DistributedSellbotBossAI):
if invoker.doId in do.involvedToons:
boss = do
break
boss = getVP(invoker)
if not boss:
return "You aren't in a VP!"
if boss.state in ('PrepareBattleThree', 'BattleThree'):
@ -429,12 +443,7 @@ def killVP():
Kills the VP.
"""
invoker = spellbook.getInvoker()
boss = None
for do in simbase.air.doId2do.values():
if isinstance(do, DistributedSellbotBossAI):
if invoker.doId in do.involvedToons:
boss = do
break
boss = getVP(invoker)
if not boss:
return "You aren't in a VP!"
boss.b_setState('Victory')