Пример #1
0
    def spawnEnemies(self, spawnPos):
        for enemyType, enemyAmount in self._areaRef.enemies.iteritems():
            for i in range(enemyAmount):
                if enemyType == enemy.koboldSkirmisher:
                    newEnemy = Digger(self._mainRef)
                else:
                    newEnemy = enemy.Enemy(self._mainRef, enemyType)

                randomPos = spawnPos.getX() + (utils.getD10(
                ) - 5) * .1, spawnPos.getY() + (utils.getD10() - 5) * .1
                newEnemy.moveEnemy(*randomPos)

                newEnemy.enemyNode.hide()
Пример #2
0
    def getDamageBonus(self):
        randomDamage = 0
        if self.damageRange == 4:
            randomDamage = utils.getD4()
        elif self.damageRange == 6:
            randomDamage = utils.getD6()
        elif self.damageRange == 8:
            randomDamage = utils.getD8()
        elif self.damageRange == 10:
            randomDamage = utils.getD10()

        return self.getStrengthModifier() + randomDamage + self.damageBonus
Пример #3
0
    def spawnEnemies(self, spawnPos):
        for enemyType, enemyAmount in self._areaRef.enemies.iteritems():
            for i in range(enemyAmount):
                if enemyType == enemy.koboldSkirmisher:
                    newEnemy = Digger(self._mainRef)
                else:
                    newEnemy = enemy.Enemy(self._mainRef, enemyType)

                randomPos = spawnPos.getX() + (utils.getD10()-5)*.1, spawnPos.getY() + (utils.getD10()-5)*.1
                newEnemy.moveEnemy(*randomPos)

                newEnemy.enemyNode.hide()
Пример #4
0
    def getDamageBonus(self):
        randomDamage = 0
        if self.damageRange == 4:
            randomDamage = utils.getD4()
        elif self.damageRange == 6:
            randomDamage = utils.getD6()
        elif self.damageRange == 8:
            randomDamage = utils.getD8()
        elif self.damageRange == 10:
            randomDamage = utils.getD10()

        return self.getStrengthModifier() + randomDamage + self.damageBonus