mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Add Laughing Man holiday end (everybody loses their head), add Laughing Man to DNA instead of explicitly showing it, add ~dna laughingman [0/1]
This commit is contained in:
parent
b7654d438d
commit
b4af78209c
17 changed files with 70 additions and 31 deletions
|
@ -371,6 +371,9 @@ class NewsManager(DistributedObject.DistributedObject):
|
|||
elif holidayId == ToontownGlobals.SPOOKY_BLACK_CAT:
|
||||
if hasattr(base, 'localAvatar') and base.localAvatar and hasattr(base.localAvatar, 'chatMgr') and base.localAvatar.chatMgr:
|
||||
self.setSpookyBlackCatHolidayEnd()
|
||||
elif holidayId == ToontownGlobals.LAUGHING_MAN:
|
||||
if hasattr(base, 'localAvatar') and base.localAvatar:
|
||||
self.setLaughingManHolidayEnd()
|
||||
elif holidayId == ToontownGlobals.TOP_TOONS_MARATHON:
|
||||
if hasattr(base, 'localAvatar') and base.localAvatar and hasattr(base.localAvatar, 'chatMgr') and base.localAvatar.chatMgr:
|
||||
self.setTopToonsMarathonEnd()
|
||||
|
@ -544,6 +547,10 @@ class NewsManager(DistributedObject.DistributedObject):
|
|||
for currToon in base.cr.toons.values():
|
||||
currToon.generateLaughingMan()
|
||||
|
||||
def setLaughingManHolidayEnd(self):
|
||||
for currToon in base.cr.toons.values():
|
||||
currToon.swapToonHead(laughingMan=False)
|
||||
|
||||
def setTopToonsMarathonStart(self):
|
||||
base.localAvatar.setSystemMessage(0, TTLocalizer.TopToonsMarathonStart)
|
||||
|
||||
|
|
|
@ -338,7 +338,7 @@ class Movie(DirectObject.DirectObject):
|
|||
|
||||
self.tutorialTom = Toon.Toon()
|
||||
dna = ToonDNA.ToonDNA()
|
||||
dna.newToonFromProperties(*('dls', 'ms', 'm', 'm', 7, 0, 7, 7, 2, 6, 2, 6, 2, 16))
|
||||
dna.newToonFromProperties(*('dls', 'ms', 'm', 'm', 7, 0, 7, 7, 2, 6, 2, 6, 2, 16, 0))
|
||||
self.tutorialTom.setDNA(dna)
|
||||
self.tutorialTom.setName(TTLocalizer.NPCToonNames[20000])
|
||||
self.tutorialTom.setPickable(0)
|
||||
|
|
|
@ -91,8 +91,6 @@ def __getSoundTrack(level, delay, duration = None, node = None):
|
|||
|
||||
|
||||
def teleportIn(attack, npc, pos = Point3(0, 0, 0), hpr = Vec3(180.0, 0.0, 0.0)):
|
||||
if npc.getName() == 'Magic Cat':
|
||||
npc.generateLaughingMan(True)
|
||||
a = Func(npc.reparentTo, attack['battle'])
|
||||
b = Func(npc.setPos, pos)
|
||||
c = Func(npc.setHpr, hpr)
|
||||
|
|
|
@ -66,7 +66,7 @@ class CogdoBarrelRoomIntro(CogdoGameMovie):
|
|||
self.frame.hide()
|
||||
backgroundGui.removeNode()
|
||||
self.toonDNA = ToonDNA.ToonDNA()
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14)
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14, 0)
|
||||
self.toonHead = Toon.Toon()
|
||||
self.toonHead.setDNA(self.toonDNA)
|
||||
self.makeSuit('sc')
|
||||
|
|
|
@ -67,7 +67,7 @@ class CogdoElevatorMovie(CogdoGameMovie):
|
|||
self.frame.hide()
|
||||
backgroundGui.removeNode()
|
||||
self.toonDNA = ToonDNA.ToonDNA()
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14)
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14, 0)
|
||||
self.toonHead = Toon.Toon()
|
||||
self.toonHead.setDNA(self.toonDNA)
|
||||
self.makeSuit('sc')
|
||||
|
|
|
@ -71,7 +71,7 @@ class CogdoExecutiveSuiteIntro(CogdoGameMovie):
|
|||
self.frame.hide()
|
||||
backgroundGui.removeNode()
|
||||
self.toonDNA = ToonDNA.ToonDNA()
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14)
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14, 0)
|
||||
self.toonHead = Toon.Toon()
|
||||
self.toonHead.setDNA(self.toonDNA)
|
||||
self.makeSuit('sc')
|
||||
|
|
|
@ -52,7 +52,7 @@ class CogdoFlyingGameIntro(CogdoGameMovie):
|
|||
def load(self):
|
||||
CogdoGameMovie.load(self)
|
||||
self.toonDNA = ToonDNA.ToonDNA()
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14)
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14, 0)
|
||||
self.toonHead = Toon.Toon()
|
||||
self.toonHead.setDNA(self.toonDNA)
|
||||
self.makeSuit('sc')
|
||||
|
|
|
@ -56,7 +56,7 @@ class CogdoMazeGameIntro(CogdoGameMovie):
|
|||
def load(self):
|
||||
CogdoGameMovie.load(self)
|
||||
self.toonDNA = ToonDNA.ToonDNA()
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14)
|
||||
self.toonDNA.newToonFromProperties('dss', 'ss', 'm', 'm', 2, 0, 2, 2, 1, 8, 1, 8, 1, 14, 0)
|
||||
self.toonHead = Toon.Toon()
|
||||
self.toonHead.setDNA(self.toonDNA)
|
||||
self.makeSuit('sc')
|
||||
|
|
|
@ -46,7 +46,7 @@ class DistributedToonStatuary(DistributedStatuary.DistributedStatuary):
|
|||
self.model.setScale(self.worldScale * 1.5, self.worldScale * 1.5, self.worldScale)
|
||||
self.getToonPropertiesFromOptional()
|
||||
dna = ToonDNA.ToonDNA()
|
||||
dna.newToonFromProperties(self.headType, self.torsoType, self.legType, self.gender, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
||||
dna.newToonFromProperties(self.headType, self.torsoType, self.legType, self.gender, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
||||
self.setupStoneToon(dna)
|
||||
self.poseToonFromTypeIndex(self.typeIndex)
|
||||
self.toon.reparentTo(self.model)
|
||||
|
|
|
@ -30,7 +30,7 @@ class TTHoodAI(HoodAI.HoodAI):
|
|||
if simbase.air.wantGloveNpc:
|
||||
NPCToons.createNPC(
|
||||
simbase.air, 2021,
|
||||
(ToontownGlobals.ToontownCentral, TTLocalizer.NPCToonNames[2021], ('dss', 'ls', 's', 'm', 13, 41, 13, 13, 1, 6, 1, 6, 0, 18), 'm', 1, NPCToons.NPC_GLOVE),
|
||||
(ToontownGlobals.ToontownCentral, TTLocalizer.NPCToonNames[2021], ('dss', 'ls', 's', 'm', 13, 41, 13, 13, 1, 6, 1, 6, 0, 18, 0), 'm', 1, NPCToons.NPC_GLOVE),
|
||||
ToontownGlobals.ToontownCentral, posIndex=0)
|
||||
|
||||
if simbase.air.wantHalloween:
|
||||
|
|
|
@ -146,7 +146,7 @@ class OZSafeZoneLoader(SafeZoneLoader):
|
|||
self.painterPete.setPlayerType(NametagGlobals.CCNonPlayer)
|
||||
|
||||
dna = ToonDNA.ToonDNA()
|
||||
dna.newToonFromProperties('hls', 'ss', 'm', 'm', 18, 0, 13, 9, 0, 0, 0, 0, 2, 15)
|
||||
dna.newToonFromProperties('hls', 'ss', 'm', 'm', 18, 0, 13, 9, 0, 0, 0, 0, 2, 15, 0)
|
||||
self.painterPete.setDNA(dna)
|
||||
|
||||
self.painterPete.setHat(43, 0, 0)
|
||||
|
|
|
@ -4988,6 +4988,16 @@ def dna(part, value):
|
|||
invoker.b_setDNAString(dna.makeNetString())
|
||||
return 'Bottom texture color index set to: ' + str(dna.botTexColor)
|
||||
|
||||
if part == 'laughingman':
|
||||
if not value.isdigit():
|
||||
return 'Laughing Man can only be 0 or 1.'
|
||||
value = int(value)
|
||||
if value != 0 and value != 1:
|
||||
return 'Laughing Man can only be 0 or 1.'
|
||||
dna.laughingMan = value
|
||||
invoker.b_setDNAString(dna.makeNetString())
|
||||
return 'Laughing Man set to: ' + str(dna.laughingMan)
|
||||
|
||||
if part == 'save':
|
||||
backup = simbase.backups.load('toon', (invoker.doId,), default={})
|
||||
backup.setdefault('dna', {})[value] = invoker.getDNAString()
|
||||
|
|
|
@ -217,8 +217,6 @@ class NPCFriendCard(DirectFrame):
|
|||
head = ToonHead.ToonHead()
|
||||
head.setupHead(dna, forGui=1)
|
||||
self.fitGeometry(head, fFlip=1, dimension=dimension)
|
||||
if NPCID == 91917:
|
||||
LaughingManGlobals.addHeadEffect(head, book=True)
|
||||
return head
|
||||
|
||||
def fitGeometry(self, geom, fFlip = 0, dimension = 0.5):
|
||||
|
|
|
@ -11580,7 +11580,8 @@ NPCToonDict = {20000: (-1,
|
|||
0,
|
||||
10,
|
||||
0,
|
||||
10),
|
||||
10,
|
||||
1),
|
||||
'm',
|
||||
0,
|
||||
NPC_REGULAR)}
|
||||
|
|
|
@ -434,8 +434,6 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
self.hatNodes = []
|
||||
self.glassesNodes = []
|
||||
self.backpackNodes = []
|
||||
self.wantLaughingMan = False
|
||||
self.hasLaughingMan = False
|
||||
self.hat = (0, 0, 0)
|
||||
self.glasses = (0, 0, 0)
|
||||
self.backpack = (0, 0, 0)
|
||||
|
@ -552,8 +550,8 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
def updateToonDNA(self, newDNA, fForce = 0):
|
||||
self.style.gender = newDNA.getGender()
|
||||
oldDNA = self.style
|
||||
if fForce or newDNA.head != oldDNA.head:
|
||||
self.swapToonHead(newDNA.head)
|
||||
if fForce or newDNA.head != oldDNA.head or newDNA.laughingMan != oldDNA.laughingMan:
|
||||
self.swapToonHead(newDNA.head, newDNA.laughingMan)
|
||||
if fForce or newDNA.torso != oldDNA.torso:
|
||||
self.swapToonTorso(newDNA.torso, genClothes=0)
|
||||
self.loop('neutral')
|
||||
|
@ -817,7 +815,7 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
self.loadAnims(HeadAnimDict[self.style.head], 'head', '500')
|
||||
self.loadAnims(HeadAnimDict[self.style.head], 'head', '250')
|
||||
|
||||
def swapToonHead(self, headStyle, copy = 1):
|
||||
def swapToonHead(self, headStyle=-1, laughingMan=-1, copy = 1):
|
||||
self.stopLookAroundNow()
|
||||
self.eyelids.request('open')
|
||||
self.unparentToonParts()
|
||||
|
@ -827,7 +825,10 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
# Bugfix: Until upstream Panda3D includes this, we have to do it here.
|
||||
if 'head' in self._Actor__commonBundleHandles:
|
||||
del self._Actor__commonBundleHandles['head']
|
||||
self.style.head = headStyle
|
||||
if headStyle > -1:
|
||||
self.style.head = headStyle
|
||||
if laughingMan > -1:
|
||||
self.style.laughingMan = laughingMan
|
||||
self.generateToonHead(copy)
|
||||
self.generateToonColor()
|
||||
self.parentToonParts()
|
||||
|
@ -835,6 +836,8 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
self.resetHeight()
|
||||
self.eyelids.request('open')
|
||||
self.startLookAround()
|
||||
if self.style.laughingMan:
|
||||
LaughingManGlobals.addToonEffect(self)
|
||||
|
||||
def generateToonColor(self):
|
||||
ToonHead.generateToonColor(self, self.style)
|
||||
|
@ -969,8 +972,8 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
return swappedTorso
|
||||
|
||||
def generateLaughingMan(self, force=False):
|
||||
if force or (not self.getHasLaughingMan() and self.getWantLaughingMan()):
|
||||
LaughingManGlobals.addToonEffect(self)
|
||||
if force or self.getWantLaughingMan():
|
||||
self.swapToonHead(laughingMan=True)
|
||||
|
||||
def generateHat(self, fromRTM = False):
|
||||
hat = self.getHat()
|
||||
|
@ -1146,10 +1149,7 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
return self.hat
|
||||
|
||||
def getWantLaughingMan(self):
|
||||
return self.wantLaughingMan or (base.cr.newsManager and base.cr.newsManager.isHolidayRunning(ToontownGlobals.LAUGHING_MAN))
|
||||
|
||||
def getHasLaughingMan(self):
|
||||
return self.hasLaughingMan
|
||||
return self.style.laughingMan or (base.cr.newsManager and base.cr.newsManager.isHolidayRunning(ToontownGlobals.LAUGHING_MAN))
|
||||
|
||||
def setGlasses(self, glassesIdx, textureIdx, colorIdx, fromRTM = False):
|
||||
self.glasses = (glassesIdx, textureIdx, colorIdx)
|
||||
|
|
|
@ -2510,6 +2510,7 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
string = string + 'sleeve texture color = %d\n' % self.sleeveTexColor
|
||||
string = string + 'bottom texture = %d\n' % self.botTex
|
||||
string = string + 'bottom texture color = %d\n' % self.botTexColor
|
||||
string = string + 'laughing man = %d\n' % self.laughingMan
|
||||
return string
|
||||
|
||||
def clone(self):
|
||||
|
@ -2541,16 +2542,23 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
dg.addUint8(self.gloveColor)
|
||||
dg.addUint8(self.legColor)
|
||||
dg.addUint8(self.headColor)
|
||||
dg.addUint8(self.laughingMan)
|
||||
elif self.type == 'u':
|
||||
notify.error('undefined avatar')
|
||||
else:
|
||||
notify.error('unknown avatar type: ', self.type)
|
||||
return dg.getMessage()
|
||||
|
||||
def getDatagramWithFallback(self, dgi, fallback=0):
|
||||
try:
|
||||
return dgi.getUint8()
|
||||
except:
|
||||
return fallback
|
||||
|
||||
def isValidNetString(self, string):
|
||||
dg = PyDatagram(string)
|
||||
dgi = PyDatagramIterator(dg)
|
||||
if dgi.getRemainingSize() != 15:
|
||||
if dgi.getRemainingSize() not in [15, 16]:
|
||||
return False
|
||||
type = dgi.getFixedString(1)
|
||||
if type not in ('t',):
|
||||
|
@ -2579,6 +2587,7 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
gloveColor = dgi.getUint8()
|
||||
legColor = dgi.getUint8()
|
||||
headColor = dgi.getUint8()
|
||||
laughingMan = self.getDatagramWithFallback(dgi, 0)
|
||||
if topTex >= len(Shirts):
|
||||
return False
|
||||
if topTexColor >= len(ClothesColors):
|
||||
|
@ -2597,6 +2606,8 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
return False
|
||||
if headColor >= len(allColorsList):
|
||||
return False
|
||||
if laughingMan != 0 and laughingMan != 1:
|
||||
return False
|
||||
return True
|
||||
|
||||
def makeFromNetString(self, string):
|
||||
|
@ -2625,6 +2636,7 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
self.gloveColor = dgi.getUint8()
|
||||
self.legColor = dgi.getUint8()
|
||||
self.headColor = dgi.getUint8()
|
||||
self.laughingMan = self.getDatagramWithFallback(dgi, 0)
|
||||
else:
|
||||
notify.error('unknown avatar type: ', self.type)
|
||||
return None
|
||||
|
@ -2658,11 +2670,12 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
self.legColor = color
|
||||
self.headColor = color
|
||||
self.gloveColor = 0
|
||||
self.laughingMan = 0
|
||||
else:
|
||||
notify.error("tuple must be in format ('%s', '%s', '%s', '%s')")
|
||||
return
|
||||
|
||||
def newToonFromProperties(self, head, torso, legs, gender, armColor, gloveColor, legColor, headColor, topTexture, topTextureColor, sleeveTexture, sleeveTextureColor, bottomTexture, bottomTextureColor):
|
||||
def newToonFromProperties(self, head, torso, legs, gender, armColor, gloveColor, legColor, headColor, topTexture, topTextureColor, sleeveTexture, sleeveTextureColor, bottomTexture, bottomTextureColor, laughingMan=0):
|
||||
self.type = 't'
|
||||
self.head = head
|
||||
self.torso = torso
|
||||
|
@ -2678,8 +2691,9 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
self.sleeveTexColor = sleeveTextureColor
|
||||
self.botTex = bottomTexture
|
||||
self.botTexColor = bottomTextureColor
|
||||
self.laughingMan = laughingMan
|
||||
|
||||
def updateToonProperties(self, head = None, torso = None, legs = None, gender = None, armColor = None, gloveColor = None, legColor = None, headColor = None, topTexture = None, topTextureColor = None, sleeveTexture = None, sleeveTextureColor = None, bottomTexture = None, bottomTextureColor = None, shirt = None, bottom = None):
|
||||
def updateToonProperties(self, head = None, torso = None, legs = None, gender = None, armColor = None, gloveColor = None, legColor = None, headColor = None, topTexture = None, topTextureColor = None, sleeveTexture = None, sleeveTextureColor = None, bottomTexture = None, bottomTextureColor = None, shirt = None, bottom = None, laughingMan = None):
|
||||
if head:
|
||||
self.head = head
|
||||
if torso:
|
||||
|
@ -2708,6 +2722,8 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
self.botTex = bottomTexture
|
||||
if bottomTextureColor:
|
||||
self.botTexColor = bottomTextureColor
|
||||
if laughingMan:
|
||||
self.laughingMan = laughingMan
|
||||
if shirt:
|
||||
str, colorIndex = shirt
|
||||
defn = ShirtStyles[str]
|
||||
|
@ -2776,6 +2792,7 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
self.legColor = color
|
||||
self.headColor = color
|
||||
self.gloveColor = 0
|
||||
self.laughingMan = 0
|
||||
|
||||
def asTuple(self):
|
||||
return (self.head,
|
||||
|
@ -2791,7 +2808,8 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
self.sleeveTex,
|
||||
self.sleeveTexColor,
|
||||
self.botTex,
|
||||
self.botTexColor)
|
||||
self.botTexColor,
|
||||
self.laughingMan)
|
||||
|
||||
def getType(self):
|
||||
if self.type == 't':
|
||||
|
@ -2903,7 +2921,10 @@ class ToonDNA(AvatarDNA.AvatarDNA):
|
|||
|
||||
def getWhiteColor(self):
|
||||
return allColorsList[0]
|
||||
|
||||
|
||||
def isLaughingMan(self):
|
||||
return self.laughingMan
|
||||
|
||||
def setTemporary(self, newHead, newArmColor, newLegColor, newHeadColor):
|
||||
if not self.cache and self.getArmColor != newArmColor:
|
||||
self.cache = (self.head,
|
||||
|
|
|
@ -8,6 +8,8 @@ from direct.interval.IntervalGlobal import *
|
|||
from direct.fsm.ClassicFSM import ClassicFSM
|
||||
from direct.fsm.State import State
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from toontown.toon import LaughingManGlobals
|
||||
|
||||
if not base.config.GetBool('want-new-anims', 1):
|
||||
HeadDict = {'dls': '/models/char/dogMM_Shorts-head-',
|
||||
'dss': '/models/char/dogMM_Skirt-head-',
|
||||
|
@ -194,6 +196,8 @@ class ToonHead(Actor.Actor):
|
|||
self.getGeomNode().setDepthTest(1)
|
||||
if dna.getAnimal() == 'dog':
|
||||
self.loop('neutral')
|
||||
if dna.laughingMan:
|
||||
LaughingManGlobals.addHeadEffect(self.getGeomNode(), book=True)
|
||||
|
||||
def fitAndCenterHead(self, maxDim, forGui = 0):
|
||||
p1 = Point3()
|
||||
|
|
Loading…
Reference in a new issue