Poodletooth-iLand/toontown/ai/CogSuitManagerAI.py

24 lines
754 B
Python
Raw Normal View History

2015-03-03 22:10:12 +00:00
from toontown.coghq import CogDisguiseGlobals
2015-06-21 08:29:47 +00:00
from toontown.suit import SuitDNA
2015-03-03 22:10:12 +00:00
class CogSuitManagerAI:
2015-06-21 08:29:47 +00:00
def recoverPart(self, toon, factoryType, suitTrack):
if suitTrack not in SuitDNA.suitDepts:
return
2015-03-03 22:10:12 +00:00
recoveredParts = [0, 0, 0, 0]
parts = toon.getCogParts()
2015-06-21 08:29:47 +00:00
suitTrack = SuitDNA.suitDepts.index(suitTrack)
2015-03-03 22:10:12 +00:00
if CogDisguiseGlobals.isSuitComplete(parts, suitTrack):
return recoveredParts
2015-06-21 08:29:47 +00:00
2015-03-03 22:10:12 +00:00
recoveredParts[suitTrack] = toon.giveGenericCogPart(factoryType, suitTrack)
2015-04-09 22:54:38 +00:00
return recoveredParts
def removeParts(self, toon, suitDept):
parts = toon.getCogParts()
2015-06-21 08:29:47 +00:00
2015-04-09 22:54:38 +00:00
if CogDisguiseGlobals.isSuitComplete(parts, suitDept):
2015-06-21 08:29:47 +00:00
toon.loseCogParts(suitDept)