From 80b5e4c5489daf07c7659bacb64ec2d6a0b8092c Mon Sep 17 00:00:00 2001 From: John Date: Sat, 8 Aug 2015 13:32:48 +0300 Subject: [PATCH] New magic word: ~secondVP - skips to second battle --- toontown/suit/DistributedCashbotBoss.py | 2 +- toontown/suit/DistributedSellbotBossAI.py | 33 ++++++++++++++--------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/toontown/suit/DistributedCashbotBoss.py b/toontown/suit/DistributedCashbotBoss.py index 2b89025c..cda0e73a 100755 --- a/toontown/suit/DistributedCashbotBoss.py +++ b/toontown/suit/DistributedCashbotBoss.py @@ -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 = {} diff --git a/toontown/suit/DistributedSellbotBossAI.py b/toontown/suit/DistributedSellbotBossAI.py index 82a740a2..40f42cfa 100755 --- a/toontown/suit/DistributedSellbotBossAI.py +++ b/toontown/suit/DistributedSellbotBossAI.py @@ -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')