public void SetAnim(animation a) { anim = a; anim.Play(); SetTexture(a.texture); dodirectional = false; }
public virtual void Fire() { if (_cooldown == 0) { if (clip == 0) { Reload(); return; } _anim = _fireAnim; _cooldown = _shootcd; audio.PlaySound("sound/revolver/shoot", 70); clip = (clip - 1).Clamp(0, 255); _anim = _fireAnim; _anim.Play(); var e = world.Player.GetLookatEntity(); if (e != null && e.GetState() == livestate.Alive) { e.DoDamage(_damage); } var c = renderer.GetCenterMapCell(); if (c != null) { c.OnShot(); } } }