Пример #1
0
 def die(self):  #self explanatory
     ParticleEngine.createPoint(
         150,
         self.x,
         self.y, (-15, 15), (-10, 40), (255, 0, 0),
         'Line',
         grav=True)  #blood/confetti depends on violence is sanctified
     self.dead = True
Пример #2
0
 def setLevel(self, lvl):#sets level, uses math
     self.level = lvl
     self.damage = self.baseDamage + (self.baseDamage * (self.level // 10))#gets the new damage
     self.expToLevel = 50 * 2**(lvl-1)#uses the explicit geometric equation to find the new exp
     self.exp = 0
     self.maxHealth = 100 + (lvl-1)*20#uses the explicit arithmetic equation to find the new max health
     self.health = self.maxHealth
     ParticleEngine.createPoint(10,self.x,self.y,(-10,10),(-10,10),(0,100,255),'Circle Rand',grav = True)#blue circles of fun are diployed
     if self.ID == self.over.obj.ID:#if the self.overlay character is this character
         self.over.addToQue('You have reached level '+str(lvl)+'!')#say good job
Пример #3
0
def fireBlast (mage,target = None):#this function shoots a fireball, mage is a character that shoots the spell and target the targeted character
    damage = 20#base damage is 20
    damage = damage + (damage * (mage.level // 10))#modifies the damge according to the mage's level
    mage.armLeft.setRotation(90, -mage.attackSpeed)#rotates the mage's arm

    if mage.faceRight == False:#x range is the x speed
        xRange = -20
    else:
        xRange = 20
    
    mage.shootProject(0,(xRange, 0),damage,mage)#shoots a projectile
    ParticleEngine.createPoint(10,mage.x,mage.y,(-10,10),(-10,10),(255,100,0),'Circle Rand',grav = True)#create an explosion of particles
    return damage#returns the damage done
Пример #4
0
    def takeDamage(self,amount,attacker = None, distance=10, flashes=2):#take a certain amount of damage
        if self.invincible == False:

            self.jump()
            self.addSpeed(distance, breakLimit=True)
            self.health -= amount
            self.over.updateHealthbar()
            ParticleEngine.createPoint(50, self.x, self.y, (-10,10), (-10,10), (255,0,0), 'Line', grav=True)#create a blood explosion
            self.control = False

            if self.player == True:
                self.flashes = 5#longer flashing for players
            
            self.invincible = True
            self.flashAmount = flashes
Пример #5
0
 def setLevel(self, lvl):  #sets level, uses math
     self.level = lvl
     self.damage = self.baseDamage + (self.baseDamage * (self.level // 10)
                                      )  #gets the new damage
     self.expToLevel = 50 * 2**(
         lvl - 1)  #uses the explicit geometric equation to find the new exp
     self.exp = 0
     self.maxHealth = 100 + (
         lvl - 1
     ) * 20  #uses the explicit arithmetic equation to find the new max health
     self.health = self.maxHealth
     ParticleEngine.createPoint(
         10,
         self.x,
         self.y, (-10, 10), (-10, 10), (0, 100, 255),
         'Circle Rand',
         grav=True)  #blue circles of fun are diployed
     if self.ID == self.over.obj.ID:  #if the self.overlay character is this character
         self.over.addToQue('You have reached level ' + str(lvl) +
                            '!')  #say good job
Пример #6
0
    def takeDamage(self,
                   amount,
                   attacker=None,
                   distance=10,
                   flashes=2):  #take a certain amount of damage
        if self.invincible == False:

            self.jump()
            self.addSpeed(distance, breakLimit=True)
            self.health -= amount
            self.over.updateHealthbar()
            ParticleEngine.createPoint(50,
                                       self.x,
                                       self.y, (-10, 10), (-10, 10),
                                       (255, 0, 0),
                                       'Line',
                                       grav=True)  #create a blood explosion
            self.control = False

            if self.player == True:
                self.flashes = 5  #longer flashing for players

            self.invincible = True
            self.flashAmount = flashes
Пример #7
0
 def die(self):#self explanatory
     ParticleEngine.createPoint(150,self.x,self.y,(-15,15),(-10,40),(255,0,0),'Line',grav = True)#blood/confetti depends on violence is sanctified
     self.dead = True