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,
              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
Ejemplo n.º 3
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

        # Flying info
        # This is local. Every client controls flight.
        self.localFlyingDropShadow = None
        self.localFlyingToon = None
        self.localFlyingToonId = 0

        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

        # for collisions
        self.flyColNode = None
        self.flyColNodePath = None

        self._flyingCollisionTaskName = None
Ejemplo n.º 4
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.6000000000000001
     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.0094999999999999998
     self.dropShadowCutoff = 15.0
     self.minHeightForText = 15.0
     self.heightTextOffset = -0.065000000000000002
     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.40000000000000002, 1.0),
         VBase4(0.40000000000000002, 0.40000000000000002, 1.0, 1.0),
         VBase4(1.0, 0.5, 1.0, 1.0)]
     delta = (self.jellyBeanStopHeight - self.jellyBeanStartHeight) / (self.numJellyBeans - 1)
     continue
     self.jellyBeanPositions = [ self.jellyBeanStartHeight + n * delta for n in range(self.numJellyBeans) ]
     self.doSimulateStep = False
 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
 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
 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 = config.GetFloat('party-team-activity-start-delay', startDelay)
     self._willBalanceTeams = False  # balanceTeams
     self._currentStatus = ''
 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 = {}
 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 = { }
Ejemplo n.º 12
0
    def __init__(self, cr, actId, dancePatternToAnims):
        DistributedPartyActivity.__init__(self, cr, actId,
                                          ActivityTypes.Continuous)
        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
        # Map of toonIds to PartyDanceActivityToonFSMs
        self.dancingToonFSMs = {}
 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
     x = 0
     y = 0
     z = 0
     return
 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
     return
Ejemplo n.º 15
0
    def __init__(self,
                 cr,
                 activityId,
                 startDelay=PartyGlobals.TeamActivityStartDelay,
                 balanceTeams=False):
        """
        Parameters
            cr is the instance of ClientRepository
            activityId is the activity's id (set in PartyGlobals)
        """
        DistributedPartyActivity.__init__(
            self,
            cr,
            activityId,
            PartyGlobals.ActivityTypes.GuestInitiated,
            wantRewardGui=True,
        )
        self.notify.debug("__init__")

        self.toonIds = (
            [],  # left team toon Ids
            [],  # right team toon Ids
        )

        self.isLocalToonPlaying = False
        self.localToonTeam = None  # a PartyGlobals.TeamActivityTeams value

        # used to even out a lopsided game
        self.advantage = 1.0

        self.waitToStartTimestamp = None  # tracks when WaitToStart began for late comers

        # These are required fields set by the ai
        self._maxPlayersPerTeam = 0
        self._minPlayersPerTeam = 0
        self._duration = 0

        self._startDelay = ConfigVariableDouble(
            "party-team-activity-start-delay", startDelay).getValue()
        self._willBalanceTeams = balanceTeams

        self._currentStatus = ""
Ejemplo n.º 16
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  # spring constant
        self.normalTrampB = 2.5  # spring damping
        self.leavingTrampB = 8.0  # increase damping to slow toon faster when leaving
        self.trampB = self.normalTrampB
        self.g = -32.0  # acceleration due to gravity
        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)  # relative to toon
        self.cameraSpeed = 2.0
        self.hopOffPos = Point3(16.0, 0.0, 0.0)  # relative to tramp
        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

        # Jelly Beans
        self.numJellyBeans = PartyGlobals.TrampolineNumJellyBeans  # These are in PartyGlobals so they can be available to the AI.
        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 range(self.numJellyBeans)
        ]
        self.doSimulateStep = False