Poodletooth-iLand/toontown/coghq/ActiveCell.py

34 lines
1.2 KiB
Python
Raw Normal View History

from panda3d.core import *
2015-03-03 16:10:12 -06:00
from otp.level import BasicEntities
from direct.directnotify import DirectNotifyGlobal
class ActiveCell(BasicEntities.DistributedNodePathEntity):
notify = DirectNotifyGlobal.directNotify.newCategory('ActiveCell')
def __init__(self, cr):
BasicEntities.DistributedNodePathEntity.__init__(self, cr)
self.occupantId = -1
self.state = 0
def announceGenerate(self):
BasicEntities.DistributedNodePathEntity.announceGenerate(self)
self.loadModel()
def loadModel(self):
if 0 and __debug__:
grid = self.level.entities.get(self.gridId, None)
if grid:
pos = grid.getPos() + Vec3(self.col * grid.cellSize, self.row * grid.cellSize, 0)
model = loader.loadModel('phase_5/models/modules/suit_walls.bam')
model.setScale(grid.cellSize, 1, grid.cellSize)
model.setP(-90)
model.flattenMedium()
model.setZ(0.05)
model.setColorScale(1, 0, 0, 0.5)
model.copyTo(self)
self.setPos(pos)
return
def setState(self, state, objId):
self.state = state
self.occupantId = objId