def setHP(self, hp): currHP = getattr(self, 'currHP', 0) if currHP > hp: self.showHpText(hp - currHP) DistributedSuitBase.setHP(self, hp) self.updateHealthBar(0, 1)
def announceGenerate(self): DistributedSuitBase.announceGenerate(self) self.corpMedallion.hide() self.healthBar.show() self.updateHealthBar(0, 1) self.walkSpeed = (ToontownGlobals.SuitWalkSpeed * SuitBattleGlobals.SuitSizes[self.dna.name] / 4.0) # Set ourselves up for a good pieing: colNode = self.find('**/distAvatarCollNode*') colNode.setTag('pieCode', str(ToontownGlobals.PieCodeInvasionSuit))
def __init__(self, cr): DistributedSuitBase.__init__(self, cr) InvasionSuitBase.__init__(self) FSM.__init__(self, 'InvasionSuitFSM') self.spawnPointId = 0 self.moveTask = None self._lerpTimestamp = 0 self._turnInterval = None self._staticPoint = (0, 0, 0) self.explodeTrack = None self.attackTarget = 0 self.attackProp = '' self.attackDamage = 0 self.exploding = False self.invasionFinale = False self._attackInterval = None self.phraseSequence = None self.finaleBrainstormSequence = None # For the Director's attacks self.brainstormSfx = loader.loadSfx( 'phase_5/audio/sfx/SA_brainstorm.ogg') self.quakeLiftSfx = loader.loadSfx( 'phase_5/audio/sfx/General_throw_miss.ogg') self.quakeLandSfx = loader.loadSfx( 'phase_3.5/audio/sfx/ENC_cogfall_apart.ogg') # Cog speeches, for when we want to manually define it phasePath = 'phase_3.5/audio/dial/' self.speechMurmurSfx = loader.loadSfx(phasePath + 'COG_VO_murmur.ogg') self.speechStatementSfx = loader.loadSfx(phasePath + 'COG_VO_statement.ogg') self.speechQuestionSfx = loader.loadSfx(phasePath + 'COG_VO_question.ogg') self.speechGruntSfx = loader.loadSfx( phasePath + 'COG_VO_grunt.ogg' ) # This one is currently the only one used in this file. Remove the rest if they aren't used before deploying. # Get a few things defined for our Shakers self.shakerRadialAttack = None self.stompSfx = loader.loadSfx('phase_5/audio/sfx/SA_tremor.ogg') self.msStompLoop = None self.msStartStomp = None self.msSoundLoop = Sequence( SoundInterval(self.stompSfx, duration=1.6, startTime=0.3, volume=0.4, node=self))
def generateAnimDict(self): animDict = DistributedSuitBase.generateAnimDict(self) if self.style.name == 'ms': # Movers and Shakers should stomp instead of walk animDict['walk'] = 'phase_5/models/char/suitB-stomp' if self.style.body == 'b': animDict['effort'] = 'phase_5/models/char/suitB-effort' animDict['jump'] = 'phase_6/models/char/suitB-jump' if self.style.body == 'c': # Suit C's (Flunky, etc.) animations are located in phase_3.5, because of the tutorial. animDict['throw-paper'] = 'phase_3.5/models/char/suitC-throw-paper' animDict[ 'throw-object'] = 'phase_3.5/models/char/suitC-throw-paper' else: # The rest of the suit animations are in phase_5, for the most part. animDict[ 'throw-paper'] = 'phase_5/models/char/suit%s-throw-paper' % ( self.style.body.upper()) animDict[ 'throw-object'] = 'phase_5/models/char/suit%s-throw-object' % ( self.style.body.upper()) return animDict
def __init__(self, cr): DistributedSuitBase.__init__(self, cr) InvasionSuitBase.__init__(self) FSM.__init__(self, 'InvasionSuitFSM') self.spawnPointId = 0 self.moveTask = None self._lerpTimestamp = 0 self._turnInterval = None self._staticPoint = (0, 0, 0) self.explodeTrack = None self.attackTarget = 0 self.attackProp = '' self.attackDamage = 0 self.exploding = False self.invasionFinale = False self._attackInterval = None self.phraseSequence = None self.finaleBrainstormSequence = None # For the Director's attacks self.brainstormSfx = loader.loadSfx('phase_5/audio/sfx/SA_brainstorm.ogg') self.quakeLiftSfx = loader.loadSfx('phase_5/audio/sfx/General_throw_miss.ogg') self.quakeLandSfx = loader.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart.ogg') # Cog speeches, for when we want to manually define it phasePath = 'phase_3.5/audio/dial/' self.speechMurmurSfx = loader.loadSfx(phasePath + 'COG_VO_murmur.ogg') self.speechStatementSfx = loader.loadSfx(phasePath + 'COG_VO_statement.ogg') self.speechQuestionSfx = loader.loadSfx(phasePath + 'COG_VO_question.ogg') self.speechGruntSfx = loader.loadSfx(phasePath + 'COG_VO_grunt.ogg') # This one is currently the only one used in this file. Remove the rest if they aren't used before deploying. # Get a few things defined for our Shakers self.shakerRadialAttack = None self.stompSfx = loader.loadSfx('phase_5/audio/sfx/SA_tremor.ogg') self.msStompLoop = None self.msStartStomp = None self.msSoundLoop = Sequence(SoundInterval(self.stompSfx, duration=1.6, startTime=0.3, volume=0.4, node=self))
def generateAnimDict(self): animDict = DistributedSuitBase.generateAnimDict(self) if self.style.name == 'ms': # Movers and Shakers should stomp instead of walk animDict['walk'] = 'phase_5/models/char/suitB-stomp' if self.style.body == 'b': animDict['effort'] = 'phase_5/models/char/suitB-effort' animDict['jump'] = 'phase_6/models/char/suitB-jump' if self.style.body == 'c': # Suit C's (Flunky, etc.) animations are located in phase_3.5, because of the tutorial. animDict['throw-paper'] = 'phase_3.5/models/char/suitC-throw-paper' animDict['throw-object'] = 'phase_3.5/models/char/suitC-throw-paper' else: # The rest of the suit animations are in phase_5, for the most part. animDict['throw-paper'] = 'phase_5/models/char/suit%s-throw-paper' % (self.style.body.upper()) animDict['throw-object'] = 'phase_5/models/char/suit%s-throw-object' % (self.style.body.upper()) return animDict
def delete(self): self.demand('Off') self.stopShakerRadialAttack() self.stopMoveTask() DistributedSuitBase.delete(self)