RIP Achievements, we are gonna have Top Toons tho

This commit is contained in:
DenialMC 2015-04-29 10:49:58 +03:00
parent 1ed2a72334
commit d4d5e61941
18 changed files with 19 additions and 534 deletions

View file

@ -839,7 +839,6 @@ dclass DistributedToon : DistributedPlayer {
setPartyCanStart(uint64) ownrecv airecv; setPartyCanStart(uint64) ownrecv airecv;
setPartyStatus(uint64, uint8) ownrecv airecv; setPartyStatus(uint64, uint8) ownrecv airecv;
announcePartyStarted(uint64) ownrecv; announcePartyStarted(uint64) ownrecv;
setAchievements(uint16[] = []) required broadcast ownrecv db;
setNeverStartedPartyRefunded(uint64, int8, uint16) ownrecv; setNeverStartedPartyRefunded(uint64, int8, uint16) ownrecv;
setDISLname(string) ram; setDISLname(string) ram;
setDISLid(uint32) ram db airecv; setDISLid(uint32) ram db airecv;

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import * from pandac.PandaModules import *
hashVal = 3917046557L hashVal = 1355680248
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 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,76 +0,0 @@
from toontown.achievements import AchievementsGlobals
from direct.interval.IntervalGlobal import *
from direct.interval.LerpInterval import *
from toontown.toonbase import ToontownGlobals
from direct.gui.DirectGui import *
from pandac.PandaModules import *
class AchievementGui:
def __init__(self):
self.queue = []
self.currentShowingAward = 0
def earnAchievement(self, achievementId):
if self.queue == []:
applause = loader.loadSfx('phase_6/audio/sfx/KART_Applause_2.ogg')
applause.play()
self.queue.append(achievementId)
self.showAchievement()
else:
self.queue.append(achievementId)
def showAchievement(self):
if self.queue != []:
if self.currentShowingAward == 0:
self.currentShowingAward = self.queue[0]
self.displayAchievement()
self.frameSequence()
def displayAchievement(self):
currentAchievement = AchievementsGlobals.AchievementImages[self.currentShowingAward]
image = loader.loadModel(currentAchievement[0])
imageNode = image.find(currentAchievement[1])
imageNode.setColor(currentAchievement[2])
imageNode.setScale(currentAchievement[3])
self.frame = OnscreenGeom(geom='phase_3/models/gui/dialog_box_gui', scale=(0.8, 1, 0.55), parent=base.a2dTopRight,
pos=(0.45, 0, -0.275))
self.image = OnscreenGeom(geom=imageNode, parent=self.frame)
self.title = OnscreenText(text='You earned an Achievement!', scale=(0.06, 0.11), font=ToontownGlobals.getMinnieFont(),
parent=self.frame, pos=(0, 0.33), align=TextNode.ACenter)
self.achievementName = OnscreenText(text=AchievementsGlobals.AchievementTitles[self.currentShowingAward], scale=(0.06, 0.09),
font=ToontownGlobals.getMinnieFont(), parent=self.frame, align=TextNode.ACenter, pos=(0, 0.2))
self.details = OnscreenText(text=AchievementsGlobals.AchievementDesc[self.currentShowingAward], scale=(0.04, 0.07),
font=ToontownGlobals.getMinnieFont(), parent=self.frame, align=TextNode.ACenter, pos=(0, -0.4))
def frameSequence(self):
self.seq = Sequence()
self.seq.append(LerpPosInterval(self.frame, 1, (-0.45, 0, -0.275)))
self.seq.append(Wait(2))
self.seq.append(LerpPosInterval(self.frame, 1, (0.45, 0, -0.275)))
self.seq.append(Func(self.cleanupCurrentFrame))
self.seq.start()
def cleanupCurrentFrame(self):
self.frame.destroy()
del self.frame
self.title.destroy()
del self.title
self.achievementName.destroy()
del self.achievementName
self.details.destroy()
del self.details
del self.queue[0]
self.currentShowingAward = 0
self.showAchievement()

View file

@ -1,168 +0,0 @@
from toontown.toonbase import ToontownGlobals
ANY_LAFF = 138
ANY_LEVEL = 13
ANY_TYPE = 1
COG = 0
V2COG = 1
SKELECOG = 2
class FriendAchievement:
def __init__(self, neededFriends=1):
self.neededFriends = neededFriends
def hasComplete(self, av):
avatarsFriends = av.getFriendsList()
if len(avatarsFriends) >= self.neededFriends:
return 1
return 0
class TrolleyAchievement:
def hasComplete(self, av):
return 1
class SuitsAchievement:
def __init__(self, neededSuits=1, neededType=ANY_TYPE, revive=0, skele=0):
self.neededSuits = neededSuits
self.neededType = neededType
self.needRevive = revive
self.needSkele = skele
def hasComplete(self, av):
avatarsRadar = av.getCogCount()
#ToontownGlobals.cog
return 0
class EstateAchievement:
def hasComplete(self, av):
return 1
class VPAchievement:
def __init__(self, neededLaff=ANY_LAFF, solo=False):
self.neededLaff = neededLaff
self.solo = solo
def hasComplete(self, laff, solo):
complete = 1
if self.neededLaff != ANY_LAFF:
if laff:
complete = 1
else:
complete = 0
if self.solo:
if solo:
complete = 1
else:
complete = 0
return complete
class CFOAchievement:
def __init__(self, neededLaff=ANY_LAFF, solo=False):
self.neededLaff = neededLaff
self.solo = solo
def hasComplete(self, laff, solo):
complete = 1
if self.neededLaff != ANY_LAFF:
if laff:
complete = 1
else:
complete = 0
if self.solo:
if solo:
complete = 1
else:
complete = 0
return complete
class CJAchievement:
def __init__(self, neededLaff=ANY_LAFF, solo=False):
self.neededLaff = neededLaff
self.solo = solo
def hasComplete(self, laff, solo):
complete = 1
if self.neededLaff != ANY_LAFF:
if laff:
complete = 1
else:
complete = 0
if self.solo:
if solo:
complete = 1
else:
complete = 0
return complete
class CEOAchievement:
def __init__(self, neededLaff=ANY_LAFF, solo=False):
self.neededLaff = neededLaff
self.solo = solo
def hasComplete(self, laff, solo):
complete = 1
if self.neededLaff != ANY_LAFF:
if laff:
complete = 1
else:
complete = 0
if self.solo:
if solo:
complete = 1
else:
complete = 0
return complete
AchievementsDict = (FriendAchievement(),
FriendAchievement(neededFriends=10),
FriendAchievement(neededFriends=50),
TrolleyAchievement(),
EstateAchievement(),
VPAchievement(),
VPAchievement(neededLaff=1),
VPAchievement(solo=True),
VPAchievement(neededLaff=1, solo=True),
CFOAchievement(),
CFOAchievement(neededLaff=1),
CFOAchievement(solo=True),
CFOAchievement(neededLaff=1, solo=True),
CJAchievement(),
CJAchievement(neededLaff=1),
CJAchievement(solo=True),
CJAchievement(neededLaff=1, solo=True),
CEOAchievement(),
CEOAchievement(neededLaff=1),
CEOAchievement(solo=True),
CEOAchievement(neededLaff=1, solo=True))
type2AchievementIds = {FriendAchievement: [0, 1, 2],
TrolleyAchievement: [3],
EstateAchievement: [4],
VPAchievement: [5, 6, 7, 8]}
def getAchievementsOfType(type):
return type2AchievementIds.get(type)

View file

@ -1,25 +0,0 @@
AchievementTitles = ('It\'s fun with friends',
'Mr Popular',
'Famous Toon',
'Trolley Time!',
'VP',
'VP',
'VP',
'VP')
AchievementDesc = ('You made a Friend!',
'You made 10 Friends!',
'You made 50 Friends!',
'You rode the Trolley!',
'You defeated the VP!',
'You defeated the VP with 1 laff!',
'You soloed the VP!',
'You soloed the VP with 1 laff!')
#(model, node, color, scale)
AchievementImages = (('phase_3.5/models/gui/friendslist_gui', '**/FriendsBox_Rollover', (1, 1, 1, 1), 1),
('phase_3.5/models/gui/friendslist_gui', '**/FriendsBox_Rollover', (1, 1, 1, 1), 1),
('phase_3.5/models/gui/friendslist_gui', '**/FriendsBox_Rollover', (1, 1, 1, 1), 1),
('phase_3.5/models/gui/stickerbook_gui', '**/trolley', (1, 1, 1, 1), 0.3),
('phase_3.5/models/gui/stickerbook_gui', '**/BossHead3Icon', (1, 1, 1, 1), 0.3),
('phase_3.5/models/gui/stickerbook_gui', '**/BossHead3Icon', (1, 1, 1, 1), 0.3),
('phase_3.5/models/gui/stickerbook_gui', '**/BossHead3Icon', (1, 1, 1, 1), 0.3),
('phase_3.5/models/gui/stickerbook_gui', '**/BossHead3Icon', (1, 1, 1, 1), 0.3))

View file

@ -1,68 +0,0 @@
from toontown.achievements import Achievements
class AchievementsManagerAI:
def __init__(self, air):
self.air = air
self.vpLaffPlayers = []
self.vpSoloPlayers = []
def toonMadeFriend(self, avId):
av = self.air.doId2do.get(avId)
if not av:
return
possibleAchievements = Achievements.getAchievementsOfType(Achievements.FriendAchievement)
for achievementId in possibleAchievements:
if not achievementId in av.getAchievements():
if Achievements.AchievementsDict[achievementId].hasComplete(av):
av.addAchievement(achievementId)
def toonPlayedMinigame(self, av):
possibleAchievements = Achievements.getAchievementsOfType(Achievements.TrolleyAchievement)
for achievementId in possibleAchievements:
if not achievementId in av.getAchievements():
if Achievements.AchievementsDict[achievementId].hasComplete(av):
av.addAchievement(achievementId)
def toonsStartedVP(self, toons):
for avId in toons:
av = self.air.doId2do.get(int(avId))
if not av:
continue
if av.getHp() == 1:
self.vpLaffPlayers.append(int(avId))
if len(toons) == 1:
self.vpSoloPlayers.append(int(toons[0]))
def toonsFinishedVP(self, toons):
possibleAchievements = Achievements.getAchievementsOfType(Achievements.VPAchievement)
for avId in toons:
av = self.air.doId2do.get(int(avId))
if not av:
continue
for achievementId in possibleAchievements:
if not achievementId in av.getAchievements():
solo = avId in self.vpSoloPlayers
laff = avId in self.vpLaffPlayers
if Achievements.AchievementsDict[achievementId].hasComplete(laff, solo):
av.addAchievement(achievementId)
while avId in self.vpSoloPlayers:
self.vpSoloPlayers.remove(avId)
while avId in self.vpLaffPlayers:
self.vpLaffPlayers.remove(avId)
def toonGotQuest(self, avId):
av = self.air.doId2do.get(avId)
if not av:
return

View file

@ -10,7 +10,6 @@ from otp.friends.FriendManagerAI import FriendManagerAI
from toontown.ai import CogPageManagerAI from toontown.ai import CogPageManagerAI
from toontown.ai import CogSuitManagerAI from toontown.ai import CogSuitManagerAI
from toontown.ai import PromotionManagerAI from toontown.ai import PromotionManagerAI
from toontown.ai.AchievementsManagerAI import AchievementsManagerAI
from toontown.ai.FishManagerAI import FishManagerAI from toontown.ai.FishManagerAI import FishManagerAI
from toontown.ai.HolidayManagerAI import HolidayManagerAI from toontown.ai.HolidayManagerAI import HolidayManagerAI
from toontown.ai.NewsManagerAI import NewsManagerAI from toontown.ai.NewsManagerAI import NewsManagerAI
@ -89,7 +88,6 @@ class ToontownAIRepository(ToontownInternalRepository):
self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True) self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
self.doLiveUpdates = self.config.GetBool('want-live-updates', False) self.doLiveUpdates = self.config.GetBool('want-live-updates', False)
self.wantTrackClsends = self.config.GetBool('want-track-clsends', False) self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
self.wantAchievements = self.config.GetBool('want-achievements', True)
self.wantGloveNpc = self.config.GetBool('want-glove-npc', True) self.wantGloveNpc = self.config.GetBool('want-glove-npc', True)
self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0) self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
self.wantHalloween = self.config.GetBool('want-halloween', False) self.wantHalloween = self.config.GetBool('want-halloween', False)
@ -112,7 +110,6 @@ class ToontownAIRepository(ToontownInternalRepository):
self.friendManager.generateWithRequired(2) self.friendManager.generateWithRequired(2)
self.questManager = QuestManagerAI(self) self.questManager = QuestManagerAI(self)
self.banManager = BanManagerAI.BanManagerAI(self) self.banManager = BanManagerAI.BanManagerAI(self)
self.achievementsManager = AchievementsManagerAI(self)
self.suitInvasionManager = SuitInvasionManagerAI(self) self.suitInvasionManager = SuitInvasionManagerAI(self)
self.blackCatMgr = DistributedBlackCatMgrAI(self) self.blackCatMgr = DistributedBlackCatMgrAI(self)
self.blackCatMgr.generateWithRequired(2) self.blackCatMgr.generateWithRequired(2)

View file

@ -172,13 +172,6 @@ class DistributedMinigameAI(DistributedObjectAI.DistributedObjectAI):
self.setGameAbort() self.setGameAbort()
def gameOver(self): def gameOver(self):
self.notify.debug('BASE: gameOver')
if simbase.air.wantAchievements:
for avId in self.avIdList:
av = self.air.doId2do.get(avId)
self.air.achievementsManager.toonPlayedMinigame(av)
self.frameworkFSM.request('frameworkWaitClientsExit') self.frameworkFSM.request('frameworkWaitClientsExit')
def enterFrameworkOff(self): def enterFrameworkOff(self):

View file

@ -1,84 +0,0 @@
import ShtikerPage
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
from toontown.achievements import AchievementsGlobals
class AchievementsPage(ShtikerPage.ShtikerPage):
def __init__(self):
ShtikerPage.ShtikerPage.__init__(self)
self.avatar = None
self.achievements = []
self.gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
self.accept(localAvatar.uniqueName('achievementsChange'), self.updatePage)
def load(self):
ShtikerPage.ShtikerPage.load(self)
self.avAchievements = localAvatar.achievements
self.title = DirectLabel(parent=self, relief=None, text=TTLocalizer.AchievementsPageTitle, text_scale=0.12, textMayChange=1, pos=(0, 0, 0.62))
start_pos = LVecBase3(0.72, 1, -0.21)
seperation = LVecBase3(0.45, 0, 0.4)
cardModel = loader.loadModel('phase_3.5/models/gui/playingCard')
incButton = (self.gui.find('**/FndsLst_ScrollUp'),
self.gui.find('**/FndsLst_ScrollDN'),
self.gui.find('**/FndsLst_ScrollUp_Rllvr'),
self.gui.find('**/FndsLst_ScrollUp'))
self.scrollFrame = DirectScrolledFrame(parent=self, frameSize=(0, 1.5, -1.2, 0), pos=(-0.75, 1, 0.52),
canvasSize=(0, 1, -7, 0), frameColor=(0.85, 0.95, 1, 1))
for achievement in xrange(len(AchievementsGlobals.AchievementTitles)):
achievementFrame = DirectFrame(parent=self.scrollFrame.getCanvas(), image=DGG.getDefaultDialogGeom(), scale=(1.3, 0, 0.32),
relief=None, pos=(start_pos.x, 1, start_pos.z - seperation.z * achievement),
text=AchievementsGlobals.AchievementTitles[achievement], text_scale=(0.05, 0.13),
text_font=ToontownGlobals.getMinnieFont(), text_pos=(0, 0, 0))
self.achievements.append(achievementFrame)
if achievement in self.avAchievements:
achievementFrame['text'] = AchievementsGlobals.AchievementTitles[achievement]
achievementFrame['text_pos'] = (0, 0.2, -0.2)
else:
achievementFrame['text'] = '???'
def setAvatar(self, av):
self.avatar = av
def updatePage(self):
self.avAchievements = localAvatar.achievements
for achievement in self.achievements:
achievement.destroy()
del self.achievements
self.achievements = []
start_pos = LVecBase3(0.72, 1, -0.21)
seperation = LVecBase3(0.45, 0, 0.4)
for achievement in xrange(len(AchievementsGlobals.AchievementTitles)):
achievementFrame = DirectFrame(parent=self.scrollFrame.getCanvas(), image=DGG.getDefaultDialogGeom(), scale=(1.3, 0, 0.32),
relief=None, pos=(start_pos.x, 1, start_pos.z - seperation.z * achievement),
text=AchievementsGlobals.AchievementTitles[achievement], text_scale=(0.05, 0.13),
text_font=ToontownGlobals.getMinnieFont(), text_pos=(0, 0, 0))
self.achievements.append(achievementFrame)
if achievement in self.avAchievements:
achievementFrame['text'] = AchievementsGlobals.AchievementTitles[achievement]
achievementFrame['text_pos'] = (0, 0.2, -0.2)
currentAchievement = AchievementsGlobals.AchievementImages[achievement]
image = loader.loadModel(currentAchievement[0])
imageNode = image.find(currentAchievement[1])
imageNode.setColor(currentAchievement[2])
img = OnscreenGeom(geom=imageNode, parent=achievementFrame, pos=(-0.3, 0, 0))
else:
achievementFrame['text'] = '???'

View file

@ -45,8 +45,7 @@ class ShtikerBook(DirectFrame, StateData.StateData):
TTLocalizer.GardenPageTitle, TTLocalizer.GardenPageTitle,
TTLocalizer.GolfPageTitle, TTLocalizer.GolfPageTitle,
TTLocalizer.PhotoPageTitle, TTLocalizer.PhotoPageTitle,
TTLocalizer.EventsPageName, TTLocalizer.EventsPageName]
TTLocalizer.AchievementsPageTitle]
return return
def setSafeMode(self, setting): def setSafeMode(self, setting):

View file

@ -219,7 +219,6 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
DistributedBossCogAI.DistributedBossCogAI.enterIntroduction(self) DistributedBossCogAI.DistributedBossCogAI.enterIntroduction(self)
self.__makeDoobers() self.__makeDoobers()
self.b_setBossDamage(0, 0, 0) self.b_setBossDamage(0, 0, 0)
self.air.achievementsManager.toonsStartedVP(self.involvedToons)
def exitIntroduction(self): def exitIntroduction(self):
DistributedBossCogAI.DistributedBossCogAI.exitIntroduction(self) DistributedBossCogAI.DistributedBossCogAI.exitIntroduction(self)
@ -399,10 +398,6 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
return return
self.b_setAttackCode(ToontownGlobals.BossCogRecoverDizzyAttack) self.b_setAttackCode(ToontownGlobals.BossCogRecoverDizzyAttack)
def enterReward(self):
self.air.achievementsManager.toonsFinishedVP(self.involvedToons)
DistributedBossCogAI.DistributedBossCogAI.enterReward(self)
@magicWord(category=CATEGORY_ADMINISTRATOR) @magicWord(category=CATEGORY_ADMINISTRATOR)
def skipVP(): def skipVP():
""" """

View file

@ -59,6 +59,7 @@ from toontown.speedchat import TTSCDecoders
from toontown.suit import SuitDNA from toontown.suit import SuitDNA
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.battle import BattleParticles
if base.wantKarts: if base.wantKarts:
@ -181,8 +182,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.gmNameTagEnabled = 0 self.gmNameTagEnabled = 0
self.gmNameTagColor = 'whiteGM' self.gmNameTagColor = 'whiteGM'
self.gmNameTagString = '' self.gmNameTagString = ''
self.achievements = []
self.canEarnAchievements = False
self.promotionStatus = [0, 0, 0, 0] self.promotionStatus = [0, 0, 0, 0]
self.buffs = [] self.buffs = []
self.redeemedCodes = [] self.redeemedCodes = []
@ -2581,10 +2580,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def setAnimalSound(self, index): def setAnimalSound(self, index):
self.animalSound = index self.animalSound = index
def setAchievements(self, achievements):
self.achievements = achievements
messenger.send(localAvatar.uniqueName('achievementsChange'))
def setBuffs(self, buffs): def setBuffs(self, buffs):
self.buffs = buffs self.buffs = buffs
self.applyBuffs() self.applyBuffs()
@ -2680,4 +2675,18 @@ def blackCat():
""" """
Ask the black cat manager to turn you into a cat. Ask the black cat manager to turn you into a cat.
""" """
base.cr.blackCatMgr.requestBlackCatTransformation() base.cr.blackCatMgr.requestBlackCatTransformation()
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[str])
def showParticle(name):
"""
Shows a particle.
"""
particle = BattleParticles.createParticleEffect(name)
if particle:
particle.start(spellbook.getTarget())
return 'Successfully started particle!'
return 'Particle %s does not exist.' % name

View file

@ -19,7 +19,6 @@ from otp.avatar import DistributedAvatarAI
from otp.avatar import DistributedPlayerAI from otp.avatar import DistributedPlayerAI
from otp.otpbase import OTPGlobals from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer from otp.otpbase import OTPLocalizer
from toontown.achievements import Achievements
from toontown.battle import SuitBattleGlobals from toontown.battle import SuitBattleGlobals
from toontown.catalog import CatalogAccessoryItem from toontown.catalog import CatalogAccessoryItem
from toontown.catalog import CatalogItem from toontown.catalog import CatalogItem
@ -93,7 +92,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.experience = None self.experience = None
self.petId = None self.petId = None
self.quests = [] self.quests = []
self.achievements = []
self.cogs = [] self.cogs = []
self.cogCounts = [] self.cogCounts = []
self.NPCFriendsDict = {} self.NPCFriendsDict = {}
@ -569,9 +567,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.friendsList.append((friendId, friendCode)) self.friendsList.append((friendId, friendCode))
self.air.questManager.toonMadeFriend(self) self.air.questManager.toonMadeFriend(self)
if self.air.wantAchievements:
self.air.achievementsManager.toonMadeFriend(self.doId)
def d_setMaxNPCFriends(self, max): def d_setMaxNPCFriends(self, max):
self.sendUpdate('setMaxNPCFriends', [max]) self.sendUpdate('setMaxNPCFriends', [max])
@ -4182,43 +4177,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def getAnimalSound(self): def getAnimalSound(self):
return self.animalSound return self.animalSound
def setAchievements(self, achievements):
for i in xrange(len(achievements)):
if not achievements[i] in xrange(len(Achievements.AchievementsDict)):
print 'Unknown AchievementId %s'%(achievements[i])
del achievements[i]
self.achievements = achievements
def d_setAchievements(self, achievements):
for i in xrange(len(achievements)):
if not achievements[i] in xrange(len(Achievements.AchievementsDict)):
print 'Unknown AchievementId %s'%(achievements[i])
del achievements[i]
self.sendUpdate('setAchievements', args=[achievements])
def b_setAchievements(self, achievements):
self.setAchievements(achievements)
self.d_setAchievements(achievements)
def getAchievements(self):
return self.achievements
def addAchievement(self, achievementId):
if achievementId in xrange(len(Achievements.AchievementsDict)):
if not achievementId in self.achievements:
achievements = self.achievements
achievements.append(achievementId)
self.b_setAchievements(achievements)
def hasAchievement(self, achievementId):
if achievementId in self.achievements:
return 1
return 0
def addBuff(self, id, duration): def addBuff(self, id, duration):
buffCount = len(self.buffs) buffCount = len(self.buffs)
if buffCount <= id: if buffCount <= id:
@ -5074,24 +5032,6 @@ def suit(command, suitName):
else: else:
return 'Invalid command.' return 'Invalid command.'
@magicWord(category=CATEGORY_PROGRAMMER, types=[str, int])
def achievements(command, achId):
invoker = spellbook.getInvoker()
if command.lower() == 'earn':
achievements = invoker.getAchievements()
achievements.append(achId)
invoker.b_setAchievements(achievements)
return 'Earnt Achievement %s'%(achId)
elif command.lower() == 'remove':
achievements = invoker.getAchievements()
achievements.remove(achId)
invoker.b_setAchievements(achievements)
return 'Removed Achievement %s'%(achId)
else:
return "Unknown Command '%s'"%(command)
@magicWord(category=CATEGORY_PROGRAMMER) @magicWord(category=CATEGORY_PROGRAMMER)
def getZone(): def getZone():
invoker = spellbook.getInvoker() invoker = spellbook.getInvoker()

View file

@ -544,9 +544,6 @@ class DistributedToonUD(DistributedObjectUD):
def flagAv(self, todo0, todo1, todo2): def flagAv(self, todo0, todo1, todo2):
pass pass
def setAchievements(self, achievements):
pass
def setRedeemedCodes(self, redeemedCodes): def setRedeemedCodes(self, redeemedCodes):
pass pass

View file

@ -20,7 +20,6 @@ from otp.avatar import DistributedPlayer
from otp.avatar import LocalAvatar from otp.avatar import LocalAvatar
from otp.avatar import PositionExaminer from otp.avatar import PositionExaminer
from otp.otpbase import OTPGlobals from otp.otpbase import OTPGlobals
from toontown.achievements import AchievementGui
from toontown.battle import Fanfare from toontown.battle import Fanfare
from toontown.battle.BattleSounds import * from toontown.battle.BattleSounds import *
from toontown.catalog import CatalogNotifyDialog from toontown.catalog import CatalogNotifyDialog
@ -34,7 +33,6 @@ from toontown.parties import PartyGlobals
from toontown.quest import QuestMap from toontown.quest import QuestMap
from toontown.quest import QuestParser from toontown.quest import QuestParser
from toontown.quest import Quests from toontown.quest import Quests
from toontown.shtiker import AchievementsPage
from toontown.shtiker import DisguisePage from toontown.shtiker import DisguisePage
from toontown.shtiker import PhotoAlbumPage from toontown.shtiker import PhotoAlbumPage
from toontown.shtiker import EventsPage from toontown.shtiker import EventsPage
@ -336,11 +334,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
self.fishPage.setAvatar(self) self.fishPage.setAvatar(self)
self.fishPage.load() self.fishPage.load()
self.book.addPage(self.fishPage, pageName=TTLocalizer.FishPageTitle) self.book.addPage(self.fishPage, pageName=TTLocalizer.FishPageTitle)
if base.wantAchievements:
self.achievementsPage = AchievementsPage.AchievementsPage()
self.achievementsPage.setAvatar(self)
self.achievementsPage.load()
self.book.addPage(self.achievementsPage, pageName=TTLocalizer.AchievementsPageTitle)
if base.wantKarts: if base.wantKarts:
self.addKartPage() self.addKartPage()
if self.disguisePageFlag: if self.disguisePageFlag:
@ -379,8 +372,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
self.accept('InputState-turnRight', self.__toonMoved) self.accept('InputState-turnRight', self.__toonMoved)
self.accept('InputState-slide', self.__toonMoved) self.accept('InputState-slide', self.__toonMoved)
self.achievementGui = AchievementGui.AchievementGui()
QuestParser.init() QuestParser.init()
return return
@ -1787,15 +1778,4 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
if petId == 0: if petId == 0:
self.petDNA = None self.petDNA = None
elif self.isLocal(): elif self.isLocal():
base.cr.addPetToFriendsMap() base.cr.addPetToFriendsMap()
def setAchievements(self, achievements):
if base.wantAchievements:
if self.canEarnAchievements:
for achievementId in achievements:
if not achievementId in self.achievements:
self.achievementGui.earnAchievement(achievementId)
else:
self.canEarnAchievements = True
DistributedToon.DistributedToon.setAchievements(self, achievements)

View file

@ -3344,7 +3344,6 @@ PhotoPageCancel = lCancel
PhotoPageClose = lClose PhotoPageClose = lClose
PhotoPageDirectory = 'Open Folder' PhotoPageDirectory = 'Open Folder'
PhotoPageTutorial = 'You haven\'t taken any snapshots yet! Press TAB to change your camera angle, and press F9 to take a snapshot.\n\n Once you\'ve made a snapshot, come here to manage and name them.' PhotoPageTutorial = 'You haven\'t taken any snapshots yet! Press TAB to change your camera angle, and press F9 to take a snapshot.\n\n Once you\'ve made a snapshot, come here to manage and name them.'
AchievePageTitle = 'Achievements\n(Coming Soon)'
BuildingPageTitle = 'Buildings\n(Coming Soon)' BuildingPageTitle = 'Buildings\n(Coming Soon)'
InventoryPageTitle = 'Gags' InventoryPageTitle = 'Gags'
InventoryPageDeleteTitle = 'DELETE GAGS' InventoryPageDeleteTitle = 'DELETE GAGS'
@ -3352,7 +3351,6 @@ InventoryPageTrackFull = 'You have all the gags in the %s track.'
InventoryPagePluralPoints = 'You will get a new\n%(trackName)s gag when you\nget %(numPoints)s more %(trackName)s points.' InventoryPagePluralPoints = 'You will get a new\n%(trackName)s gag when you\nget %(numPoints)s more %(trackName)s points.'
InventoryPageSinglePoint = 'You will get a new\n%(trackName)s gag when you\nget %(numPoints)s more %(trackName)s point.' InventoryPageSinglePoint = 'You will get a new\n%(trackName)s gag when you\nget %(numPoints)s more %(trackName)s point.'
InventoryPageNoAccess = 'You do not have access to the %s track yet.' InventoryPageNoAccess = 'You do not have access to the %s track yet.'
AchievementsPageTitle = 'Achievements'
NPCFriendPageTitle = 'SOS Toons' NPCFriendPageTitle = 'SOS Toons'
PartyDateFormat = '%(mm)s %(dd)d, %(yyyy).4d' PartyDateFormat = '%(mm)s %(dd)d, %(yyyy).4d'
PartyTimeFormat = '%d:%.2d %s' PartyTimeFormat = '%d:%.2d %s'

View file

@ -166,7 +166,6 @@ class ToonBase(OTPBase.OTPBase):
self.wantBingo = self.config.GetBool('want-fish-bingo', 1) self.wantBingo = self.config.GetBool('want-fish-bingo', 1)
self.wantKarts = self.config.GetBool('want-karts', 1) self.wantKarts = self.config.GetBool('want-karts', 1)
self.wantNewSpecies = self.config.GetBool('want-new-species', 0) self.wantNewSpecies = self.config.GetBool('want-new-species', 0)
self.wantAchievements = self.config.GetBool('want-achievements', 1)
self.inactivityTimeout = self.config.GetFloat('inactivity-timeout', ToontownGlobals.KeyboardTimeout) self.inactivityTimeout = self.config.GetFloat('inactivity-timeout', ToontownGlobals.KeyboardTimeout)
if self.inactivityTimeout: if self.inactivityTimeout:
self.notify.debug('Enabling Panda timeout: %s' % self.inactivityTimeout) self.notify.debug('Enabling Panda timeout: %s' % self.inactivityTimeout)