Exemplo n.º 1
0
    def handleHealthChange(self, hp, oldHp):
        BaseLocalAvatar.handleHealthChange(self, hp, oldHp)

        delta = hp - oldHp
        if delta == 0:
            return

        CIGlobals.makeDeltaTextEffect(delta, base.a2dBottomLeft,
                                      (0.07, 0, 0.1))
Exemplo n.º 2
0
    def handleHealthChange(self, hp, oldHp):
        if hp > 0 and oldHp < 1:
            if self.cr.playGame and self.cr.playGame.getPlace():
                if self.cr.playGame.getPlace().fsm.getCurrentState().getName(
                ) == 'walk':
                    if self.cr.playGame.getPlace(
                    ).walkStateData.fsm.getCurrentState().getName(
                    ) == 'deadWalking':
                        self.cr.playGame.getPlace().walkStateData.fsm.request(
                            'walking')
            if self.animFSM.getCurrentState().getName() == 'deadNeutral':
                self.b_setAnimState("neutral")
            elif self.animFSM.getCurrentState().getName() == 'deadWalk':
                self.b_setAnimState("run")

        BaseLocalAvatar.handleHealthChange(self, hp, oldHp)

        DistributedPlayerToon.handleHealthChange(self, hp, oldHp)