parties: make fireworks better

This commit is contained in:
Aidan 2014-02-01 16:58:35 -05:00
parent 49a5dc534a
commit 3889005e80
4 changed files with 16 additions and 20 deletions

View file

@ -1369,8 +1369,9 @@ dclass DistributedPartyCannon : DistributedObject {
};
dclass DistributedPartyFireworksActivity : DistributedPartyActivity {
setEventId(uint8) required broadcast;
setShowStyle(uint8) required broadcast;
setEventId(uint8 eventId) required broadcast;
setShowStyle(uint8 style) required broadcast;
setSongId(uint8 songId) required broadcast;
};
dclass DistributedPartyTrampolineActivity : DistributedPartyActivity {

View file

@ -104,11 +104,7 @@ class FireworkShowMixin:
else:
FireworkShowMixin.notify.warning('Invalid fireworks event ID: %d' % eventId)
return None
# For alpha, make all the fireworks display the New Years fireworks message.
startMessage = TTLocalizer.FireworksNewYearsEveBeginning
endMessage = TTLocalizer.FireworksNewYearsEveEnding
self.showMusic = loader.loadMusic(musicFile)
self.showMusic.setVolume(1)
@ -164,10 +160,7 @@ class FireworkShowMixin:
else:
FireworkShowMixin.notify.warning('Invalid fireworks event ID: %d' % eventId)
return None
# For alpha, make all the fireworks display the New Years fireworks message.
endMessage = TTLocalizer.FireworksNewYearsEveEnding
if self.__checkHoodValidity() and hasattr(base.cr.playGame.hood, 'sky') and base.cr.playGame.hood.sky:
postShow = Sequence(Func(base.cr.playGame.hood.sky.show), Parallel(LerpColorScaleInterval(base.cr.playGame.hood.sky, 2.5, Vec4(1, 1, 1, 1)), LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 2.5, Vec4(1, 1, 1, 1)), LerpColorScaleInterval(base.localAvatar, 2.5, Vec4(1, 1, 1, 1))), Func(self.__restoreDDFog), Func(self.restoreCameraLens), Func(base.setBackgroundColor, DefaultBackgroundColor), Func(self.showMusic.stop), Func(base.localAvatar.setSystemMessage, 0, endMessage))
if self.restorePlaygroundMusic:

View file

@ -35,6 +35,9 @@ class DistributedPartyFireworksActivity(DistributedPartyActivity, FireworkShowMi
def setShowStyle(self, showStyle):
DistributedPartyFireworksActivity.notify.debug('setShowStyle( %d )' % showStyle)
self.showStyle = showStyle
def setSongId(self, songId):
self.songId = songId
def load(self):
DistributedPartyFireworksActivity.notify.debug('load')
@ -123,14 +126,14 @@ class DistributedPartyFireworksActivity(DistributedPartyActivity, FireworkShowMi
timeSinceStart = globalClockDelta.localElapsedTime(showStartTimestamp)
if timeSinceStart > self.rocketActor.getDuration('launch'):
self.rocketActor.hide()
self.startShow(self.eventId, self.showStyle, 0, showStartTimestamp)
self.startShow(self.eventId, self.showStyle, self.songId, showStartTimestamp)
else:
self.rocketActor.play('launch')
self.rocketParticleSeq = Sequence(Wait(RocketSoundDelay), Func(base.playSfx, self.launchSound), Func(self.rocketExplosionEffect.start), Wait(RocketDirectionDelay), LerpHprInterval(self.rocketActor, 4.0, Vec3(0, 0, -60)), Func(self.rocketExplosionEffect.end), Func(self.rocketActor.hide))
self.rocketParticleSeq.start()
taskMgr.doMethodLater(FireworksPostLaunchDelay, self.startShow, self.taskName('delayedStartShow'), extraArgs=[self.eventId,
self.showStyle,
0,
self.songId,
showStartTimestamp,
self.root])

View file

@ -2,7 +2,9 @@ from direct.directnotify import DirectNotifyGlobal
from toontown.parties.DistributedPartyActivityAI import DistributedPartyActivityAI
from direct.distributed.ClockDelta import globalClockDelta
from direct.fsm.FSM import FSM
from toontown.effects import FireworkShows
import PartyGlobals
import random
class DistributedPartyFireworksActivityAI(DistributedPartyActivityAI, FSM):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedPartyFireworksActivityAI")
@ -11,18 +13,15 @@ class DistributedPartyFireworksActivityAI(DistributedPartyActivityAI, FSM):
DistributedPartyActivityAI.__init__(self, air, parent, activityTuple)
FSM.__init__(self, 'DistributedPartyActivityAI')
self.state = 'Idle'
def setEventId(self, todo0):
return
def getEventId(self):
return PartyGlobals.FireworkShows.Summer
def setShowStyle(self, todo0):
pass
def getShowStyle(self):
return 0
return random.randint(0, len(FireworkShows.shows[PartyGlobals.FireworkShows.Summer]) - 1)
def getSongId(self):
return random.randint(0, 1)
def toonJoinRequest(self):
avId = self.air.getAvatarIdFromSender()