def __init__(self, cr): try: self.LocalToon_initialized return except: self.LocalToon_initialized = 1 DistributedToon.__init__(self, cr) self.avatarChoice = cr.localAvChoice self.smartCamera = SmartCamera() self.chatInput = ChatInput() self.moneyGui = MoneyGui() self.pieGui = PieGui(self.pies) self.laffMeter = LaffOMeter() self.runSfx = base.loadSfx( "phase_3.5/audio/sfx/AV_footstep_runloop.ogg") self.runSfx.setLoop(True) self.walkSfx = base.loadSfx( "phase_3.5/audio/sfx/AV_footstep_walkloop.ogg") self.walkSfx.setLoop(True) self.controlManager = ControlManager.ControlManager(True, False) self.offset = 3.2375 self.movementKeymap = { "forward": 0, "backward": 0, "left": 0, "right": 0, "jump": 0 } self.avatarMovementEnabled = False self.isMoving_forward = False self.isMoving_side = False self.isMoving_back = False self.isMoving_jump = False base.cTrav = CollisionTraverser()
def __init__(self, cr): try: self.LocalToon_initialized except: self.LocalToon_initialized = 1 DistributedToon.DistributedToon.__init__(self, cr) self.soundRun = base.loadSfx('phase_3.5/audio/sfx/AV_footstep_runloop.wav') self.soundWalk = base.loadSfx('phase_3.5/audio/sfx/AV_footstep_walkloop.wav') newScale = oldScale = 0.8 self.cTrav = CollisionTraverser('base.cTrav') base.pushCTrav(self.cTrav) self.cTrav.setRespectPrevTransform(1) self.avatarControlsEnabled = 0 self.controlManager = ControlManager.ControlManager(True, False) self.setupControls() self.initializeSmartCamera() self.cameraPositions = [] self.animMultiplier = 1.0 self.runTimeout = 2.5 self.isPageUp = 0 self.isPageDown = 0 self.movingFlag = 0 self.swimmingFlag = 0 self.lastNeedH = None self.jumpLandAnimFixTask = None self.fov = DefaultCameraFov self.accept('avatarMoving', self.clearPageUpDown)
def __init__(self, cr, chatMgr, talkAssistant=None, passMessagesThrough=False): try: self.LocalAvatar_initialized return except: pass self.LocalAvatar_initialized = 1 DistributedAvatar.DistributedAvatar.__init__(self, cr) DistributedSmoothNode.DistributedSmoothNode.__init__(self, cr) self.cTrav = CollisionTraverser('base.cTrav') base.pushCTrav(self.cTrav) self.cTrav.setRespectPrevTransform(1) self.avatarControlsEnabled = 0 self.controlManager = ControlManager.ControlManager( True, passMessagesThrough) self.initializeCollisions() self.initializeSmartCamera() self.cameraPositions = [] self.animMultiplier = 1.0 self.runTimeout = 2.5 self.customMessages = [] self.chatMgr = chatMgr base.talkAssistant = talkAssistant self.commonChatFlags = 0 self.garbleChat = 1 self.teleportAllowed = 1 self.lockedDown = 0 self.isPageUp = 0 self.isPageDown = 0 self.soundRun = None self.soundWalk = None self.sleepFlag = 0 self.neverSleep = 0 self.isDisguised = 0 self.movingFlag = 0 self.swimmingFlag = 0 self.lastNeedH = None self.accept('friendOnline', self.__friendOnline) self.accept('friendOffline', self.__friendOffline) self.accept('clickedWhisper', self.clickedWhisper) self.accept('playerOnline', self.__playerOnline) self.accept('playerOffline', self.__playerOffline) self.sleepCallback = None self.accept('wakeup', self.wakeUp) self.jumpLandAnimFixTask = None self.fov = OTPGlobals.DefaultCameraFov self.accept('avatarMoving', self.clearPageUpDown) self.nametag2dNormalContents = Nametag.CSpeech self.showNametag2d() self.setPickable(0) self.cameraLerp = None return
def __init__(self, cr, head, headtype, headcolor, torsocolor, legcolor, gender, torsotype, legtype, name, shirtcolor, shortscolor, shirt, short, sleeve): self.cr = cr self.head = head self.headtype = headtype self.hr, self.hg, self.hb, self.ha = headcolor self.tr, self.tg, self.tb, self.ta = torsocolor self.lr, self.lg, self.lb, self.la = legcolor self.shir, self.shig, self.shib, self.shia = shirtcolor self.shor, self.shog, self.shob, self.shoa = shortscolor self.shirt = shirt self.short = short self.sleeve = sleeve self.gender = gender self.torsotype = torsotype self.legtype = legtype self.name = name base.avatar = None self.sb = ShtickerBook(self) self.laffMeter = LaffOMeter() self.run_sfx = loader.loadSfx("phase_3.5/audio/sfx/AV_footstep_runloop.ogg") self.run_sfx.setLoop(True) self.walk_sfx = loader.loadSfx("phase_3.5/audio/sfx/AV_footstep_walkloop.ogg") self.walk_sfx.setLoop(True) self.hoodUtil = HoodUtil(self.cr) self.smart_cam = SmartCamera.SmartCamera() self.isThrowing = False self.controlManager = ControlManager.ControlManager(True, False) self.offset = 3.2375 self.keyMap = {"forward":0,"backward":0, "left":0, "right":0, "jump":0} base.cTrav = CollisionTraverser('general_traverser') self.dFov = CIGlobals.DefaultCameraFov self.oFov = CIGlobals.OriginalCameraFov self.createReady()
def __init__(self, player): self.player = player self.arrowKeys = ArrowKeys.ArrowKeys() self.controlManager = ControlManager.ControlManager() self.win = False
def __init__(self, cr): try: self.LocalToon_initialized return except: self.LocalToon_initialized = 1 DistributedToon.__init__(self, cr) self.gagStartKey = config.GetString('gag-start-key') self.gagThrowKey = config.GetString('gag-throw-key') self.avatarChoice = cr.localAvChoice self.smartCamera = SmartCamera() self.chatInput = ChatInput() self.moneyGui = MoneyGui() self.laffMeter = LaffOMeter() self.positionExaminer = PositionExaminer() self.friendRequestManager = FriendRequestManager() self.friendsList = FriendsList() self.panel = ToonPanel() friendsgui = loader.loadModel( 'phase_3.5/models/gui/friendslist_gui.bam') self.friendButton = DirectButton( geom=(friendsgui.find('**/FriendsBox_Closed'), friendsgui.find('**/FriendsBox_Rollover'), friendsgui.find('**/FriendsBox_Rollover')), text=("", "Friends", "Friends", ""), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), text_scale=0.065, text_pos=(0, -0.2), relief=None, parent=base.a2dTopRight, pos=(-0.18, 0.0, -0.17), command=self.friendsButtonClicked, scale=0.75) friendsgui.removeNode() del friendsgui self.hideFriendButton() self.runSfx = base.loadSfx( "phase_3.5/audio/sfx/AV_footstep_runloop.ogg") self.runSfx.setLoop(True) self.walkSfx = base.loadSfx( "phase_3.5/audio/sfx/AV_footstep_walkloop.ogg") self.walkSfx.setLoop(True) self.controlManager = ControlManager.ControlManager(True, False) self.offset = 3.2375 self.firstPersonCamPos = None self.movementKeymap = { "forward": 0, "backward": 0, "left": 0, "right": 0, "jump": 0 } self.avatarMovementEnabled = False self.isMoving_forward = False self.isMoving_side = False self.isMoving_back = False self.isMoving_jump = False self.gagThrowBtn = None self.myBattle = None self.gagsTimedOut = False self.needsToSwitchToGag = None self.gagsEnabled = False self.pickerTrav = None self.pickerRay = None self.pickerRayNode = None self.pickerHandler = None self.rolledOverTag = None self.inTutorial = False self.hasDoneJump = False self.lastState = None self.lastAction = None self.jumpHardLandIval = None