2015-08-14 18:24:08 -05:00
|
|
|
from toontown.safezone import DistributedTreasureAI
|
|
|
|
from toontown.safezone import TreasureGlobals
|
2015-03-03 16:10:12 -06:00
|
|
|
|
2015-08-14 18:24:08 -05:00
|
|
|
class DistributedCashbotBossTreasureAI(DistributedTreasureAI.DistributedTreasureAI):
|
2015-03-03 16:10:12 -06:00
|
|
|
|
|
|
|
def __init__(self, air, boss, goon, style, fx, fy, fz):
|
|
|
|
pos = goon.getPos()
|
2015-08-14 18:24:08 -05:00
|
|
|
type = TreasureGlobals.SafeZoneTreasureSpawns[style][0]
|
|
|
|
DistributedTreasureAI.DistributedTreasureAI.__init__(self, air, boss, type, pos[0], pos[1], 0)
|
2015-03-03 16:10:12 -06:00
|
|
|
self.goonId = goon.doId
|
|
|
|
self.style = style
|
|
|
|
self.finalPosition = (fx, fy, fz)
|
2015-08-14 18:24:08 -05:00
|
|
|
|
|
|
|
def validAvatar(self, av):
|
|
|
|
if av.getHp() < av.getMaxHp() and av.getHp() > 0:
|
|
|
|
av.toonUp(self.healAmount)
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
return False
|
2015-03-03 16:10:12 -06:00
|
|
|
|
|
|
|
def getGoonId(self):
|
|
|
|
return self.goonId
|
|
|
|
|
|
|
|
def setGoonId(self, goonId):
|
|
|
|
self.goonId = goonId
|
|
|
|
|
|
|
|
def b_setGoonId(self, goonId):
|
|
|
|
self.setGoonId(goonId)
|
|
|
|
self.d_setGoonId(goonId)
|
|
|
|
|
|
|
|
def d_setGoonId(self, goonId):
|
|
|
|
self.sendUpdate('setGoonId', [goonId])
|
|
|
|
|
|
|
|
def getStyle(self):
|
|
|
|
return self.style
|
|
|
|
|
|
|
|
def setStyle(self, hoodId):
|
|
|
|
self.style = hoodId
|
|
|
|
|
|
|
|
def b_setStyle(self, hoodId):
|
|
|
|
self.setStyle(hoodId)
|
|
|
|
self.d_setStyle(hoodId)
|
|
|
|
|
|
|
|
def d_setStyle(self, hoodId):
|
|
|
|
self.sendUpdate('setStyle', [hoodId])
|
|
|
|
|
|
|
|
def getFinalPosition(self):
|
|
|
|
return self.finalPosition
|
|
|
|
|
|
|
|
def setFinalPosition(self, x, y, z):
|
|
|
|
self.finalPosition = (x, y, z)
|
|
|
|
|
|
|
|
def b_setFinalPosition(self, x, y, z):
|
|
|
|
self.setFinalPosition(x, y, z)
|
|
|
|
self.d_setFinalPosition(x, y, z)
|
|
|
|
|
|
|
|
def d_setFinalPosition(self, x, y, z):
|
2015-08-14 18:24:08 -05:00
|
|
|
self.sendUpdate('setFinalPosition', [x, y, z])
|