def unload(self): self.notify.debug('unload') if self.gui is not None: self.gui.unload() del self.gui Cannon.unload(self) if self.sign is not None: self.sign.removeNode() self.sign = None self.ignoreAll() return
def __init__(self, cr): DistributedObject.__init__(self, cr) Cannon.__init__(self, parent=self.getParentNodePath()) self.localCannonMoving = False self.active = False self.activityDoId = 0 self.activity = None self.gui = None self.toonInsideAvId = 0 self.sign = None self.controllingToonAvId = None return
def load(self): self.notify.debug('load') Cannon.load(self, self.uniqueName('Cannon')) if base.cr and base.cr.partyManager and base.cr.partyManager.getShowDoid(): nameText = TextNode('nameText') nameText.setCardAsMargin(0.1, 0.1, 0.1, 0.1) nameText.setCardDecal(True) nameText.setCardColor(1.0, 1.0, 1.0, 0.0) r = 232.0 / 255.0 g = 169.0 / 255.0 b = 23.0 / 255.0 nameText.setTextColor(r, g, b, 1) nameText.setAlign(nameText.ACenter) nameText.setShadowColor(0, 0, 0, 1) nameText.setText(str(self.doId)) namePlate = self.parentNode.attachNewNode(nameText) namePlate.setDepthWrite(0) namePlate.setPos(0, 0, 8) namePlate.setScale(3)
def deactivate(self): self.ignore(self.getEnterCollisionName()) Cannon.hide(self) self.active = False
def activate(self): self.accept(self.getEnterCollisionName(), self.__handleToonCollisionWithCannon) Cannon.show(self) self.active = True