All holiday decorations and activities

This commit is contained in:
DenialMC 2015-05-13 21:36:11 +03:00
parent 5b8a0428cb
commit 26781efc6c
9 changed files with 44 additions and 109 deletions

View file

@ -3225,8 +3225,6 @@ dclass DistributedPartyManager : DistributedObject {
updateToPublicPartyCountUdToAllAi(uint32 partyCount, uint64 partyId) airecv;
requestShardIdZoneIdForHostId(uint32) clsend airecv;
sendShardIdZoneIdToAvatar(uint32, uint32);
partyManagerUdStartingUp() airecv;
partyManagerUdLost() airecv;
updateAllPartyInfoToUd(uint32, uint64, uint32, uint32, uint8, uint8, string, uint8 [], uint64);
forceCheckStart();
requestMw(uint32, string, uint32, uint32);

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import *
hashVal = 2027986859
hashVal = 2004269787
from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot

View file

@ -1,21 +1,13 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from PartyGlobals import *
import PartyUtils
import time
# ugh all these activities
from toontown.parties.DistributedPartyJukeboxActivityAI import DistributedPartyJukeboxActivityAI
from toontown.parties.DistributedPartyDanceActivityAI import DistributedPartyDanceActivityAI
from toontown.parties.DistributedPartyJukebox40ActivityAI import DistributedPartyJukebox40ActivityAI
from toontown.parties.DistributedPartyDance20ActivityAI import DistributedPartyDance20ActivityAI
from toontown.parties.DistributedPartyCogActivityAI import DistributedPartyCogActivityAI
from toontown.parties.DistributedPartyTrampolineActivityAI import DistributedPartyTrampolineActivityAI
from toontown.parties.DistributedPartyVictoryTrampolineActivityAI import DistributedPartyVictoryTrampolineActivityAI
from toontown.parties.DistributedPartyCatchActivityAI import DistributedPartyCatchActivityAI
from toontown.parties.DistributedPartyTugOfWarActivityAI import DistributedPartyTugOfWarActivityAI
from toontown.parties.DistributedPartyCannonActivityAI import DistributedPartyCannonActivityAI
from toontown.parties.DistributedPartyCannonAI import DistributedPartyCannonAI
from toontown.parties.DistributedPartyFireworksActivityAI import DistributedPartyFireworksActivityAI
import DistributedPartyCannonAI, DistributedPartyCannonActivityAI, DistributedPartyCatchActivityAI, DistributedPartyCogActivityAI, DistributedPartyDanceActivityAI
import DistributedPartyDance20ActivityAI, DistributedPartyFireworksActivityAI, DistributedPartyJukeboxActivityAI, DistributedPartyJukebox40ActivityAI
import DistributedPartyTrampolineActivityAI, DistributedPartyTugOfWarActivityAI, DistributedPartyValentineDanceActivityAI
import DistributedPartyValentineDance20ActivityAI, DistributedPartyValentineJukeboxActivityAI, DistributedPartyValentineJukebox40ActivityAI
import DistributedPartyValentineTrampolineActivityAI, DistributedPartyVictoryTrampolineActivityAI, DistributedPartyWinterCatchActivityAI
import DistributedPartyWinterCogActivityAI, DistributedPartyWinterTrampolineActivityAI
import PartyUtils, time
"""
dclass DistributedParty : DistributedObject {
@ -59,16 +51,23 @@ class DistributedPartyAI(DistributedObjectAI):
DistributedObjectAI.generate(self)
# make stuff
actId2Class = {
ActivityIds.PartyJukebox: DistributedPartyJukeboxActivityAI,
ActivityIds.PartyTrampoline: DistributedPartyTrampolineActivityAI,
ActivityIds.PartyVictoryTrampoline: DistributedPartyVictoryTrampolineActivityAI,
ActivityIds.PartyCatch: DistributedPartyCatchActivityAI,
ActivityIds.PartyDance: DistributedPartyDanceActivityAI,
ActivityIds.PartyTugOfWar: DistributedPartyTugOfWarActivityAI,
ActivityIds.PartyFireworks: DistributedPartyFireworksActivityAI,
ActivityIds.PartyJukebox40: DistributedPartyJukebox40ActivityAI,
ActivityIds.PartyDance20: DistributedPartyDance20ActivityAI,
ActivityIds.PartyCog: DistributedPartyCogActivityAI,
ActivityIds.PartyCatch: DistributedPartyCatchActivityAI.DistributedPartyCatchActivityAI,
ActivityIds.PartyCog: DistributedPartyCogActivityAI.DistributedPartyCogActivityAI,
ActivityIds.PartyDance: DistributedPartyDanceActivityAI.DistributedPartyDanceActivityAI,
ActivityIds.PartyDance20: DistributedPartyDance20ActivityAI.DistributedPartyDance20ActivityAI,
ActivityIds.PartyFireworks: DistributedPartyFireworksActivityAI.DistributedPartyFireworksActivityAI,
ActivityIds.PartyJukebox: DistributedPartyJukeboxActivityAI.DistributedPartyJukeboxActivityAI,
ActivityIds.PartyJukebox40: DistributedPartyJukebox40ActivityAI.DistributedPartyJukebox40ActivityAI,
ActivityIds.PartyTrampoline: DistributedPartyTrampolineActivityAI.DistributedPartyTrampolineActivityAI,
ActivityIds.PartyTugOfWar: DistributedPartyTugOfWarActivityAI.DistributedPartyTugOfWarActivityAI,
ActivityIds.PartyValentineDance: DistributedPartyValentineDanceActivityAI.DistributedPartyValentineDanceActivityAI,
ActivityIds.PartyValentineDance20: DistributedPartyValentineDance20ActivityAI.DistributedPartyValentineDance20ActivityAI,
ActivityIds.PartyValentineJukebox: DistributedPartyValentineJukeboxActivityAI.DistributedPartyValentineJukeboxActivityAI,
ActivityIds.PartyValentineJukebox40: DistributedPartyValentineJukebox40ActivityAI.DistributedPartyValentineJukebox40ActivityAI,
ActivityIds.PartyValentineTrampoline: DistributedPartyValentineTrampolineActivityAI.DistributedPartyValentineTrampolineActivityAI,
ActivityIds.PartyVictoryTrampoline: DistributedPartyVictoryTrampolineActivityAI.DistributedPartyVictoryTrampolineActivityAI,
ActivityIds.PartyWinterCatch: DistributedPartyWinterCatchActivityAI.DistributedPartyWinterCatchActivityAI,
ActivityIds.PartyWinterCog: DistributedPartyWinterCogActivityAI.DistributedPartyWinterCogActivityAI
}
for activity in self.info['activities']:
actId = activity[0]
@ -78,9 +77,9 @@ class DistributedPartyAI(DistributedObjectAI):
self.activities.append(act)
elif actId == ActivityIds.PartyCannon:
if not self.cannonActivity:
self.cannonActivity = DistributedPartyCannonActivityAI(self.air, self.doId, activity)
self.cannonActivity = DistributedPartyCannonActivityAI.DistributedPartyCannonActivityAI(self.air, self.doId, activity)
self.cannonActivity.generateWithRequired(self.zoneId)
act = DistributedPartyCannonAI(self.air)
act = DistributedPartyCannonAI.DistributedPartyCannonAI(self.air)
act.setActivityDoId(self.cannonActivity.doId)
x, y, h = activity[1:] # ignore activity ID
x = PartyUtils.convertDistanceFromPartyGrid(x, 0)

View file

@ -166,14 +166,7 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD):
self.__updatePartyCount(partyId)
def partyManagerAIHello(self, channel):
# Upon AI boot, DistributedPartyManagerAIs are supposed to say hello.
# They send along the DPMAI's doId as well, so that I can talk to them later.
print 'AI with base channel %s, will send replies to DPM %s' % (simbase.air.getAvatarIdFromSender(), channel)
self.senders2Mgrs[simbase.air.getAvatarIdFromSender()] = channel
self.sendToAI('partyManagerUdStartingUp', [])
# In addition, set up a postRemove where we inform this AI that the UD has died
self.air.addPostRemove(self._makeAIMsg('partyManagerUdLost', [], channel))
def addParty(self, avId, partyId, start, end, isPrivate, inviteTheme, activities, decorations, inviteeIds):
PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S'

View file

@ -70,10 +70,10 @@ ChangePartyFieldErrorCode = PythonUtil.Enum(('AllOk',
'AlreadyRefunded'))
ActivityTypes = PythonUtil.Enum(('HostInitiated', 'GuestInitiated', 'Continuous'))
PartyGateDenialReasons = PythonUtil.Enum(('Unavailable', 'Full'))
ActivityIds = PythonUtil.Enum(('PartyJukebox',
ActivityIds = PythonUtil.Enum(('PartyCatch',
'PartyJukebox',
'PartyCannon',
'PartyTrampoline',
'PartyCatch',
'PartyDance',
'PartyTugOfWar',
'PartyFireworks',
@ -110,24 +110,9 @@ PartyEditorActivityOrder = [ ActivityIds.PartyClock,
ActivityIds.PartyCog,
ActivityIds.PartyWinterCog,
ActivityIds.PartyFireworks]
MutuallyExclusiveActivities = ((ActivityIds.PartyJukebox, ActivityIds.PartyJukebox40),
(ActivityIds.PartyValentineJukebox, ActivityIds.PartyValentineJukebox40),
MutuallyExclusiveActivities = ((ActivityIds.PartyJukebox, ActivityIds.PartyJukebox40, ActivityIds.PartyValentineJukebox, ActivityIds.PartyValentineJukebox40),
(ActivityIds.PartyDance, ActivityIds.PartyDance20),
(ActivityIds.PartyValentineDance, ActivityIds.PartyValentineDance20))
VictoryPartyActivityIds = frozenset([ActivityIds.PartyVictoryTrampoline])
VictoryPartyReplacementActivityIds = frozenset([ActivityIds.PartyTrampoline])
WinterPartyActivityIds = frozenset([ActivityIds.PartyWinterCatch, ActivityIds.PartyWinterTrampoline, ActivityIds.PartyWinterCog])
WinterPartyReplacementActivityIds = frozenset([ActivityIds.PartyCatch, ActivityIds.PartyTrampoline, ActivityIds.PartyCog])
ValentinePartyActivityIds = frozenset([ActivityIds.PartyValentineDance,
ActivityIds.PartyValentineDance20,
ActivityIds.PartyValentineJukebox,
ActivityIds.PartyValentineJukebox40,
ActivityIds.PartyValentineTrampoline])
ValentinePartyReplacementActivityIds = frozenset([ActivityIds.PartyDance,
ActivityIds.PartyDance20,
ActivityIds.PartyJukebox,
ActivityIds.PartyJukebox40,
ActivityIds.PartyTrampoline])
DecorationIds = PythonUtil.Enum(('BalloonAnvil',
'BalloonStage',
'Bow',
@ -156,21 +141,6 @@ DecorationIds = PythonUtil.Enum(('BalloonAnvil',
'BalloonAnvilValentine'))
DECORATION_VOLUME = 1.0
DECORATION_CUTOFF = 45
VictoryPartyDecorationIds = frozenset([DecorationIds.BannerVictory,
DecorationIds.CannonVictory,
DecorationIds.CogStatueVictory,
DecorationIds.TubeCogVictory])
WinterPartyDecorationIds = frozenset([DecorationIds.cogIceCreamWinter,
DecorationIds.StageWinter,
DecorationIds.CogStatueWinter,
DecorationIds.snowman,
DecorationIds.snowDoodle])
VictoryPartyReplacementDecorationIds = frozenset([DecorationIds.BannerJellyBean])
ValentinePartyDecorationIds = frozenset([DecorationIds.BalloonAnvilValentine,
DecorationIds.HeartBanner,
DecorationIds.HeartTarget,
DecorationIds.FlyingHeart])
ValentinePartyReplacementDecorationIds = frozenset([DecorationIds.BalloonAnvil, DecorationIds.BannerJellyBean])
GoToPartyStatus = PythonUtil.Enum(('AllowedToGo',
'PartyFull',
'PrivateParty',

View file

@ -3587,40 +3587,36 @@ PartyDecorationNameDict = {0: {'editor': 'Balloon Anvil',
9: {'editor': 'Pinwheel',
'description': 'Colorful twirling for everyone!'},
10: {'editor': 'Gag Globe',
'description': 'Gag and star globe designed by Olivea'},
'description': 'Gag and star globe'},
11: {'editor': 'Bean Banner',
'description': 'A Jellybean banner designed by Cassidy'},
'description': 'A Jellybean banner'},
12: {'editor': 'Gag Cake',
'description': 'A Topsy Turvy gag cake designed by Felicia'},
'description': 'A Topsy Turvy gag cake'},
13: {'editor': "Cupid's Heart",
'description': 'Ready...Aim...\nValenToons!'},
14: {'editor': 'Candy Hearts\n Banner',
'description': "Who doesn't love candy hearts?"},
15: {'editor': 'Flying Heart',
'description': 'This heart is getting carried away!'},
16: {'editor': 'Victory Bandstand',
'description': 'All our new friends are ready to dance!'},
17: {'editor': 'Victory Banner',
16: {'editor': 'Victory Banner',
'description': 'Not just a normal banner!'},
18: {'editor': 'Confetti Cannons',
17: {'editor': 'Confetti Cannons',
'description': 'BOOM! Confetti! Fun!'},
19: {'editor': 'Cog & Doodle',
18: {'editor': 'Cog & Doodle',
'description': "Ouch! That's gotta hurt."},
20: {'editor': 'Cog Flappy Man',
19: {'editor': 'Cog Flappy Man',
'description': 'A Cog full of hot air, what a shock!'},
21: {'editor': 'Cog Ice Cream',
'description': 'A Cog looking his best.'},
22: {'editor': 'CogCicle',
20: {'editor': 'CogCicle',
'description': 'A Cog looking his holiday best.'},
23: {'editor': 'Holiday Bandstand',
21: {'editor': 'Holiday Bandstand',
'description': 'Everyone loves a Holiday Party!'},
24: {'editor': 'Chilly Cog',
22: {'editor': 'Chilly Cog',
'description': "Ouch! That's gotta hurt."},
25: {'editor': 'Snowman',
23: {'editor': 'Snowman',
'description': "So cool, he's hot!"},
26: {'editor': 'SnowDoodle',
24: {'editor': 'SnowDoodle',
'description': 'His only trick is being cold!'},
27: {'editor': 'ValenToons Anvil',
25: {'editor': 'ValenToons Anvil',
'description': "We've got your heart on a string!"}}
ActivityLabel = 'Cost - Activity Name'
PartyDoYouWantToPlan = 'Would you like to plan a new party right now?'

View file

@ -21,17 +21,10 @@ class DistributedPartyManagerAI(DistributedObjectAI):
self.id2Party = {}
self.pubPartyInfo = {}
self.idPool = range(self.air.ourChannel, self.air.ourChannel + 100000)
# get 100 ids at the start and top up
#taskMgr.doMethodLater(0, self.__getIds, 'DistributedPartyManagerAI___getIds')
def receiveId(self, ids):
self.idPool += ids
# def __getIds(self, task):
# if len(self.idPool) < 50:
# self.air.globalPartyMgr.allocIds(100 - len(self.idPool))
# taskMgr.doMethodLater(180, self.__getIds, 'DistributedPartyManagerAI___getIds')
def _makePartyDict(self, struct):
PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S'
party = {}
@ -48,15 +41,6 @@ class DistributedPartyManagerAI(DistributedObjectAI):
# struct[16] = partystatus
return party
# Management stuff
def partyManagerUdStartingUp(self):
# This is sent in reply to the GPMAI's hello
self.notify.info("uberdog has said hello")
def partyManagerUdLost(self):
# well fuck. ud died.
self.notify.warning("uberdog lost!")
def addPartyRequest(self, hostId, startTime, endTime, isPrivate, inviteTheme, activities, decorations, inviteeIds):
if hostId != simbase.air.getAvatarIdFromSender():
self.air.writeServerEvent('suspicious',simbase.air.getAvatarIdFromSender(),'Toon tried to create a party as someone else!')

View file

@ -7,8 +7,6 @@ class DistributedPartyManagerUD(DistributedObjectUD):
def announceGenerate(self):
DistributedObjectUD.announceGenerate(self)
self.sendUpdate('partyManagerUdStartingUp') # Shouldn't have to send to anyone special, as the field is airecv
def addParty(self, todo0, todo1, todo2, todo3, todo4, todo5, todo6, todo7, todo8, todo9):
pass
@ -114,9 +112,6 @@ class DistributedPartyManagerUD(DistributedObjectUD):
def sendShardIdZoneIdToAvatar(self, shardId, zoneId):
pass
def partyManagerUdStartingUp(self):
pass
def updateAllPartyInfoToUd(self, todo0, todo1, todo2, todo3, todo4, todo5, todo6, todo7, todo8):
pass