public Attack(Attack attack, Actor source) : base(attack) { attackType = attack.attackType; damage = attack.damage; sourceUnit = source.unitType; source.curAnim = key; direction = Global.getVectorAngle(source.direction); if (this.GetType() != typeof(CollisionDamage)) source.SetAttackTimer(attack.cooldown); }
public void Damaged(Attack attack) { velocity.X = (float)Math.Cos(attack.direction) * 100; velocity.Y = (float)Math.Sin(attack.direction) * 100; health -= attack.damage; }
public void Damaged(Attack attack) { Global.scene.damageText.Add(new DamageText(attack.damage, col_rect)); Global.scene.entitiesToAdd.Add(new DamageEffect(this)); velocity.X = (float)Math.Cos(attack.direction) * 400; velocity.Y = (float)Math.Sin(attack.direction) * 400; health -= attack.damage; stun_timer.Start(); invicibility_timer.Start(); state.canMove = false; }