Пример #1
0
 def __init__(self,
              cr,
              activityId,
              startDelay=PartyGlobals.TeamActivityStartDelay,
              balanceTeams=False):
     DistributedPartyActivity.__init__(
         self,
         cr,
         activityId,
         PartyGlobals.ActivityTypes.GuestInitiated,
         wantRewardGui=True)
     self.notify.debug('__init__')
     self.toonIds = ([], [])
     self.isLocalToonPlaying = False
     self.localToonTeam = None
     self.advantage = 1.0
     self.waitToStartTimestamp = None
     self._maxPlayersPerTeam = 0
     self._minPlayersPerTeam = 0
     self._duration = 0
     self._startDelay = base.config.GetFloat(
         'party-team-activity-start-delay', startDelay)
     self._willBalanceTeams = balanceTeams
     self._currentStatus = ''
     return
 def __init__(self, cr):
     DistributedPartyActivity.__init__(
         self, cr, PartyGlobals.ActivityIds.PartyCatch, PartyGlobals.ActivityTypes.HostInitiated, wantRewardGui=True
     )
     self.setUsesSmoothing()
     self.setUsesLookAround()
     self._sNumGen = SerialNumGen()
 def __init__(self, cr, actId, phaseToMusicData):
     DistributedPartyActivity.__init__(self, cr, actId, ActivityTypes.Continuous)
     self.phaseToMusicData = phaseToMusicData
     self.jukebox = None
     self.gui = None
     self.tunes = []
     self.music = None
     self.currentSongData = None
     self.localQueuedSongInfo = None
     self.localQueuedSongListItem = None
Пример #4
0
 def __init__(self, cr):
     DistributedPartyActivity.__init__(
         self,
         cr,
         PartyGlobals.ActivityIds.PartyCatch,
         PartyGlobals.ActivityTypes.HostInitiated,
         wantRewardGui=True)
     self.setUsesSmoothing()
     self.setUsesLookAround()
     self._sNumGen = SerialNumGen()
 def __init__(self, cr, doJellyBeans = True, doTricks = False, texture = None):
     DistributedPartyTrampolineActivity.notify.debug('__init__')
     DistributedPartyActivity.__init__(self, cr, PartyGlobals.ActivityIds.PartyTrampoline, PartyGlobals.ActivityTypes.GuestInitiated, wantLever=False, wantRewardGui=True)
     self.doJellyBeans = doJellyBeans
     self.doTricks = doTricks
     self.texture = texture
     self.toon = None
     self.trampHeight = 3.6
     self.trampK = 400.0
     self.normalTrampB = 2.5
     self.leavingTrampB = 8.0
     self.trampB = self.normalTrampB
     self.g = -32.0
     self.jumpBoost = 330.0
     self.beginningBoost = 500.0
     self.beginningBoostThreshold = self.trampHeight + 1.5
     self.earlyJumpThreshold = 75.0
     self.boingThreshold = 300.0
     self.turnFactor = 120.0
     self.stepDT = 0.001
     self.targetCameraPos = Point3(0.0, 40.0, 10.0)
     self.cameraSpeed = 2.0
     self.hopOffPos = Point3(16.0, 0.0, 0.0)
     self.indicatorFactor = 0.0095
     self.dropShadowCutoff = 15.0
     self.minHeightForText = 15.0
     self.heightTextOffset = -0.065
     self.beanOffset = 0.5
     self.guiBeanOffset = -0.02
     self.jumpTextShown = False
     self.toonJumped = False
     self.turnLeft = False
     self.turnRight = False
     self.leavingTrampoline = False
     self.toonVelocity = 0.0
     self.topHeight = 0.0
     self.lastPeak = 0.0
     self.beginRoundInterval = None
     self.hopOnAnim = None
     self.hopOffAnim = None
     self.flashTextInterval = None
     self.numJellyBeans = PartyGlobals.TrampolineNumJellyBeans
     self.jellyBeanBonus = PartyGlobals.TrampolineJellyBeanBonus
     self.jellyBeanStartHeight = 20.0
     self.jellyBeanStopHeight = 90.0
     self.jellyBeanColors = [VBase4(1.0, 0.5, 0.5, 1.0),
      VBase4(0.5, 1.0, 0.5, 1.0),
      VBase4(0.5, 1.0, 1.0, 1.0),
      VBase4(1.0, 1.0, 0.4, 1.0),
      VBase4(0.4, 0.4, 1.0, 1.0),
      VBase4(1.0, 0.5, 1.0, 1.0)]
     delta = (self.jellyBeanStopHeight - self.jellyBeanStartHeight) / (self.numJellyBeans - 1)
     self.jellyBeanPositions = [ self.jellyBeanStartHeight + n * delta for n in xrange(self.numJellyBeans) ]
     self.doSimulateStep = False
     return
 def __init__(self, cr, activityId, startDelay = PartyGlobals.TeamActivityStartDelay, balanceTeams = False):
     DistributedPartyActivity.__init__(self, cr, activityId, PartyGlobals.ActivityTypes.GuestInitiated, wantRewardGui=True)
     self.notify.debug('__init__')
     self.toonIds = ([], [])
     self.isLocalToonPlaying = False
     self.localToonTeam = None
     self.advantage = 1.0
     self.waitToStartTimestamp = None
     self._maxPlayersPerTeam = 0
     self._minPlayersPerTeam = 0
     self._duration = 0
     self._startDelay = base.config.GetFloat('party-team-activity-start-delay', startDelay)
     self._willBalanceTeams = balanceTeams
     self._currentStatus = ''
     return
 def __init__(self, cr, actId, dancePatternToAnims, model = 'phase_13/models/parties/danceFloor'):
     DistributedPartyActivity.__init__(self, cr, actId, ActivityTypes.Continuous)
     self.model = model
     self.danceFloor = None
     self.localToonDancing = False
     self.keyCodes = None
     self.gui = None
     self.currentCameraMode = None
     self.orthoWalk = None
     self.cameraParallel = None
     self.localToonDanceSequence = None
     self.localPatternsMatched = []
     self.dancePatternToAnims = dancePatternToAnims
     self.dancingToonFSMs = {}
     return
Пример #8
0
 def __init__(self, cr):
     DistributedPartyActivity.__init__(self,
                                       cr,
                                       ActivityIds.PartyCannon,
                                       ActivityTypes.Continuous,
                                       wantRewardGui=True)
     self.gui = None
     self.firingCannon = None
     self.shadowNode = None
     self.partyDoId = None
     self.splash = None
     self.dustCloud = None
     self.lastWakeTime = 0
     self.localFlyingDropShadow = None
     self.localFlyingToon = None
     self.localFlyingToonId = 0
     self._lastBroadcastTime = -self.BroadcastPeriod
     self._dirtyNewVel = None
     self.hitBumper = 0
     self.hitCloud = 0
     self.lastPos = Vec3(0, 0, 0)
     self.lastVel = Vec3(0, 0, 0)
     self.vel = Vec3(0, 0, 0)
     self.landingPos = Vec3(0, 0, 0)
     self.t = 0
     self.lastT = 0
     self.deltaT = 0
     self._lastCloudHit = None
     self.cameraPos = Vec3(0, -15.0, -25.0)
     self.cameraSpeed = 5.0
     self.camNode = None
     self.flyingToonOffsetRotation = 0
     self.flyingToonOffsetAngle = 0
     self.flyingToonOffsetX = 0
     self.flyingToonOffsetY = 0
     self.flyingToonCloudsHit = 0
     self.initialFlyVel = 0
     self._localPlayedBefore = False
     self.hitTrack = None
     self.cTrav = None
     self.flyColNode = None
     self.flyColNodePath = None
     self._flyingCollisionTaskName = None
 def __init__(self, cr):
     DistributedPartyActivity.__init__(self, cr, ActivityIds.PartyCannon, ActivityTypes.Continuous, wantRewardGui=True)
     self.gui = None
     self.firingCannon = None
     self.shadowNode = None
     self.partyDoId = None
     self.splash = None
     self.dustCloud = None
     self.lastWakeTime = 0
     self.localFlyingDropShadow = None
     self.localFlyingToon = None
     self.localFlyingToonId = 0
     self._lastBroadcastTime = -self.BroadcastPeriod
     self._dirtyNewVel = None
     self.hitBumper = 0
     self.hitCloud = 0
     self.lastPos = Vec3(0, 0, 0)
     self.lastVel = Vec3(0, 0, 0)
     self.vel = Vec3(0, 0, 0)
     self.landingPos = Vec3(0, 0, 0)
     self.t = 0
     self.lastT = 0
     self.deltaT = 0
     self._lastCloudHit = None
     self.cameraPos = Vec3(0, -15.0, -25.0)
     self.cameraSpeed = 5.0
     self.camNode = None
     self.flyingToonOffsetRotation = 0
     self.flyingToonOffsetAngle = 0
     self.flyingToonOffsetX = 0
     self.flyingToonOffsetY = 0
     self.flyingToonCloudsHit = 0
     self.initialFlyVel = 0
     self._localPlayedBefore = False
     self.hitTrack = None
     self.cTrav = None
     self.flyColNode = None
     self.flyColNodePath = None
     self._flyingCollisionTaskName = None
Пример #10
0
 def __init__(self, cr, doJellyBeans=True, doTricks=False, texture=None):
     DistributedPartyTrampolineActivity.notify.debug('__init__')
     DistributedPartyActivity.__init__(
         self,
         cr,
         PartyGlobals.ActivityIds.PartyTrampoline,
         PartyGlobals.ActivityTypes.GuestInitiated,
         wantLever=False,
         wantRewardGui=True)
     self.doJellyBeans = doJellyBeans
     self.doTricks = doTricks
     self.texture = texture
     self.toon = None
     self.trampHeight = 3.6
     self.trampK = 400.0
     self.normalTrampB = 2.5
     self.leavingTrampB = 8.0
     self.trampB = self.normalTrampB
     self.g = -32.0
     self.jumpBoost = 330.0
     self.beginningBoost = 500.0
     self.beginningBoostThreshold = self.trampHeight + 1.5
     self.earlyJumpThreshold = 75.0
     self.boingThreshold = 300.0
     self.turnFactor = 120.0
     self.stepDT = 0.001
     self.targetCameraPos = Point3(0.0, 40.0, 10.0)
     self.cameraSpeed = 2.0
     self.hopOffPos = Point3(16.0, 0.0, 0.0)
     self.indicatorFactor = 0.0095
     self.dropShadowCutoff = 15.0
     self.minHeightForText = 15.0
     self.heightTextOffset = -0.065
     self.beanOffset = 0.5
     self.guiBeanOffset = -0.02
     self.jumpTextShown = False
     self.toonJumped = False
     self.turnLeft = False
     self.turnRight = False
     self.leavingTrampoline = False
     self.toonVelocity = 0.0
     self.topHeight = 0.0
     self.lastPeak = 0.0
     self.beginRoundInterval = None
     self.hopOnAnim = None
     self.hopOffAnim = None
     self.flashTextInterval = None
     self.numJellyBeans = PartyGlobals.TrampolineNumJellyBeans
     self.jellyBeanBonus = PartyGlobals.TrampolineJellyBeanBonus
     self.jellyBeanStartHeight = 20.0
     self.jellyBeanStopHeight = 90.0
     self.jellyBeanColors = [
         VBase4(1.0, 0.5, 0.5, 1.0),
         VBase4(0.5, 1.0, 0.5, 1.0),
         VBase4(0.5, 1.0, 1.0, 1.0),
         VBase4(1.0, 1.0, 0.4, 1.0),
         VBase4(0.4, 0.4, 1.0, 1.0),
         VBase4(1.0, 0.5, 1.0, 1.0)
     ]
     delta = (self.jellyBeanStopHeight -
              self.jellyBeanStartHeight) / (self.numJellyBeans - 1)
     self.jellyBeanPositions = [
         self.jellyBeanStartHeight + n * delta
         for n in xrange(self.numJellyBeans)
     ]
     self.doSimulateStep = False
     return