Example #1
0
	def hitTick(self, tPos):
		from Code.Units.Stats import calcKnockback
		for u in PTRS["UNITS"].getTargets(self.owner.team, False, True):
			d = dist(u.getPos(), tPos)
			if d <= self.AoE:
				ang = math.atan2(u.getPos()[1] - tPos[1], u.getPos()[0] - tPos[0])
				amount = u.addDamage(self.calcDamage(self.owner, u, self.owner.getStat("attack"), 1), self.owner, self.getDamageType(), stunFactor = self.getStunFactor())
				u.addBuff(Buffs.StatBuff(self, u, 200, {"moveSpeed": 0.3}))
				self.owner.hitTarget(u, amount)
Example #2
0
	def explodeAt(self, tPos, target, angle):
		from Code.Units.Stats import calcKnockback
		for u in PTRS["UNITS"].getTargets(self.owner.team, False, True):
			d = dist(u.getPos(), tPos)
			if d <= u.size + self.AoE:
				if target is u:
					ang = angle
				else:
					ang = math.atan2(u.getPos()[1] - tPos[1], u.getPos()[0] - tPos[0])
				amount = u.addDamage(self.calcDamage(self.owner, u, self.owner.getStat("attack"), 1), self.owner, self.getDamageType(), stunFactor = self.getStunFactor())
				u.addKnockback(calcKnockback(ang, u, self.getKnockbackAmount(u)))
				u.addBuff(Buffs.StatBuff(self, u, 200, {"moveSpeed":0.5}))
				self.owner.hitTarget(u, amount)
Example #3
0
 def interactWithUnit(self, shrine):
     if self.favour < self.FavourLevels[2]:
         self.unit.addDamage(self.unit.getMaxHealth() / 3.0, None, 0)
         PTRS["EFFECTS"].addEffect(
             Effects.SpellEffect("Ignite", self.unit.getPos(),
                                 self.unit.floor, 40, True, None,
                                 self.unit))
     elif self.favour > self.FavourLevels[-2]:
         self.unit.heal(self.unit.getMaxHealth() / 4.0, None)
         self.unit.addBuff(
             Buffs.StatBuff(None, self.unit, 200, {
                 "moveSpeed": 1.2,
                 "defense": 20
             }))
         PTRS["EFFECTS"].addEffect(
             Effects.SpellEffect("Buffed", self.unit.getPos(),
                                 self.unit.floor, 40, True, None,
                                 self.unit))
Example #4
0
	def hitTarget(self, target, angle, attack, damageMod):
		amount = target.addDamage(self.calcDamage(self.owner, target, attack, damageMod), self.owner, self.getDamageType(), stunFactor = self.getStunFactor())
		self.owner.hitTarget(target, amount)
		target.addBuff(Buffs.StatBuff(self, target, 300, {"moveSpeed":0.9}))