Example #1
0
    def shiftTheBattlefield(self):
        bSuccess = False

        playerPos = self.playerNode.getPos()
        for enemy in self._enemyListRef:
            enemyPos = enemy.enemyNode.getPos()
            if utils.getIsInRange(playerPos, enemyPos, self.combatRange):
                bSuccess = True
                if self.getStrengthModifier() + utils.getD20() > enemy.armorClass:
                    self._hudRef.printFeedback('Shift the Battlefield hit', True)
                    self.enemyFleeFromPlayer(enemy)
    
                    # Might want to replace the getD8 to depend on the player's weapon
                    dmg = 2 * utils.getD8() + self.getStrengthModifier()
                    enemy.receiveDamage(dmg)

                    enemy.enemyModel.play('hit')
                else:
                    #print 'shiftTheBattlefield missed'
                    self._hudRef.printFeedback('Shift the Battlefield missed')
                    dmg = (2 * utils.getD8() + self.getStrengthModifier()) / 2
                    enemy.receiveDamage(dmg)

                    enemy.enemyModel.play('hit')

        return bSuccess
Example #2
0
    def thicketOfBlades(self):
        bSuccess = False

        numEntries = self.attackCollisionHandler.getNumEntries()
        if numEntries > 0:
            self.attackCollisionHandler.sortEntries()

            for i in range(numEntries):
                entry = self.attackCollisionHandler.getEntry(i).getIntoNode()
                entryName = entry.getName()[:-6]
                #print('entryFound:', entryName)

                enemy = utils.enemyDictionary[entryName]
                if enemy is not None and not enemy.getIsDead():
                    if utils.getIsInRange(self.playerNode.getPos(), enemy.enemyNode.getPos(), self.combatRange):
                        bSuccess  = True
                        if self.getStrengthModifier() + utils.getD20() > enemy.armorClass:
                            self._hudRef.printFeedback('Thicket of Blades hit', True)
                            enemy.slowMovementByPercentage(50, 10) # slow by 50 % in 10 seconds, automatically removes it again
                            enemy.enemyModel.play('hit')
                        else:
                            #print 'thicketOfBlades missed'
                            self._hudRef.printFeedback('Thicket of Blades missed')

        return bSuccess
Example #3
0
    def getAttackBonus(self):
        modifier = self.getStrengthModifier() if self.getStrengthModifier() > self.getDexterityModifier() else self.getDexterityModifier()
        ab = self.attackBonus + (self.level / 2) + modifier# + utils.getD20()

        if self._scenarioHandlerRef.getHasDDA():
            attackBonusModifier = self._ddaHandlerRef.attackBonusModifier
            if attackBonusModifier < 0:
                ab -= attackBonusModifier
                if ab < 1:
                    ab = 1

        return ab + utils.getD20()
Example #4
0
    def getAttackBonus(self):
        modifier = self.getStrengthModifier() if self.getStrengthModifier(
        ) > self.getDexterityModifier() else self.getDexterityModifier()
        ab = self.attackBonus + (self.level / 2) + modifier  # + utils.getD20()

        if self._scenarioHandlerRef.getHasDDA():
            attackBonusModifier = self._ddaHandlerRef.attackBonusModifier
            if attackBonusModifier < 0:
                ab -= attackBonusModifier
                if ab < 1:
                    ab = 1

        return ab + utils.getD20()
Example #5
0
    def bullRush(self):
        bSuccess = False

        enemy = self.getCurrentTarget()
        if enemy is not None and not enemy.getIsDead():
            if self.state == 'Combat':
                node = enemy.enemyNode
                print 'Bull rush:', node
                bSuccess = True

                if self.getStrengthModifier() + utils.getD20() > enemy.armorClass:
                    self._hudRef.printFeedback('Bull Rush hit', True)
                    self.enemyFleeFromPlayer(enemy)

                    self.playerModel.play('attack')
                    enemy.playHitAnimation()
                else:
                    #print 'bullRush missed'
                    self._hudRef.printFeedback('Bull Rush missed')

        return bSuccess
Example #6
0
 def getAttackBonus(self):
     modifier = self.getStrengthModifier() if self.getStrengthModifier(
     ) > self.getDexterityModifier() else self.getDexterityModifier()
     return self.attackBonus + (self.level / 2) + modifier + utils.getD20()
Example #7
0
 def getAttackBonus(self):
     modifier = self.getStrengthModifier() if self.getStrengthModifier() > self.getDexterityModifier() else self.getDexterityModifier()
     return self.attackBonus + (self.level / 2) + modifier + utils.getD20()