mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 20:22:33 -06:00
34 lines
1.2 KiB
Python
Executable file
34 lines
1.2 KiB
Python
Executable file
from panda3d.core import *
|
|
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
|