From 50bbe79aac26c672fbf3a08625e6a95bacb1e8d3 Mon Sep 17 00:00:00 2001 From: Nigger Date: Sat, 4 Apr 2015 03:30:05 -0400 Subject: [PATCH] Minor tweaks to cog invasions, preparing for v3 cogs and the other cogdo types --- toontown/suit/DistributedSuitPlannerAI.py | 6 ++++++ toontown/suit/SuitInvasionGlobals.py | 2 ++ toontown/suit/SuitInvasionManagerAI.py | 18 +++++++++++++++--- toontown/toonbase/ToontownGlobals.py | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/toontown/suit/DistributedSuitPlannerAI.py b/toontown/suit/DistributedSuitPlannerAI.py index 30a15d1b..a5bdedc1 100644 --- a/toontown/suit/DistributedSuitPlannerAI.py +++ b/toontown/suit/DistributedSuitPlannerAI.py @@ -24,6 +24,12 @@ from toontown.toonbase import ToontownGlobals ALLOWED_FO_TRACKS = 's' if config.GetBool('want-lawbot-cogdo', True): ALLOWED_FO_TRACKS += 'l' +if config.GetBool('want-cashbot-cogdo', False): + ALLOWED_FO_TRACKS += 'c' +if config.GetBool('want-bossbot-cogdo', False): + ALLOWED_FO_TRACKS += 'b' +if config.GetBool('want-omni-cogdo', False): + ALLOWED_FO_TRACKS += 'slcb' DEFAULT_COGDO_RATIO = .5 diff --git a/toontown/suit/SuitInvasionGlobals.py b/toontown/suit/SuitInvasionGlobals.py index ff85acfd..be8467e7 100644 --- a/toontown/suit/SuitInvasionGlobals.py +++ b/toontown/suit/SuitInvasionGlobals.py @@ -1,8 +1,10 @@ # Types: INVASION_TYPE_NORMAL = 0 INVASION_TYPE_MEGA = 1 +INVASION_TYPE_BRUTAL = 2 # Flags: IFSkelecog = 1 << 0 IFWaiter = 1 << 1 IFV2 = 1 << 2 +IFV3 = 1 << 3 \ No newline at end of file diff --git a/toontown/suit/SuitInvasionManagerAI.py b/toontown/suit/SuitInvasionManagerAI.py index abad6687..ccc23c42 100644 --- a/toontown/suit/SuitInvasionManagerAI.py +++ b/toontown/suit/SuitInvasionManagerAI.py @@ -53,7 +53,7 @@ class SuitInvasionManagerAI: # It's impossible to determine the invading Cog. return False - if flags not in (0, IFV2, IFSkelecog, IFWaiter): + if flags not in (0, IFV3, IFV2, IFSkelecog, IFWaiter): # The provided flag combination is not possible. return False @@ -65,7 +65,7 @@ class SuitInvasionManagerAI: # Invalid suit type. return False - if type not in (INVASION_TYPE_NORMAL, INVASION_TYPE_MEGA): + if type not in (INVASION_TYPE_NORMAL, INVASION_TYPE_MEGA, INVASION_TYPE_BRUTAL): # Invalid invasion type. return False @@ -80,7 +80,9 @@ class SuitInvasionManagerAI: if type == INVASION_TYPE_NORMAL: self.total = 1000 elif type == INVASION_TYPE_MEGA: - self.total = 0xFFFFFFFF + self.total = 5000 + elif type == INVASION_TYPE_BRUTAL: + self.total = 10000 self.remaining = self.total self.flySuits() @@ -97,6 +99,16 @@ class SuitInvasionManagerAI: if type == INVASION_TYPE_NORMAL: timeout = config.GetInt('invasion-timeout', 1800) taskMgr.doMethodLater(timeout, self.stopInvasion, 'invasionTimeout') + + # If this is a mega invasion, and the players take to long to defeat + # all of the cogs, we want the invasion to take a bit longer to timeout: + if type == INVASION_TYPE_MEGA: + timeout = config.GetInt('invasion-timeout', 3200) + + # If this is a brutal invasion, the players will have a very long time to + # Defeat the cogs before the invasion times out: + if type == INVASION_TYPE_BRUTAL: + timeout = config.GetInt('invasion-timeout', 10000) self.sendInvasionStatus() return True diff --git a/toontown/toonbase/ToontownGlobals.py b/toontown/toonbase/ToontownGlobals.py index cfad1f72..40d58ff5 100644 --- a/toontown/toonbase/ToontownGlobals.py +++ b/toontown/toonbase/ToontownGlobals.py @@ -1657,7 +1657,7 @@ AV_TOUCH_CHECK_DIST_Z = 5.0 AV_TOUCH_CHECK_TIMELIMIT_CL = 0.002 AV_TOUCH_COUNT_LIMIT = 5 AV_TOUCH_COUNT_TIME = 300 -GloveCost = 2000 +GloveCost = 1 # Buffs...