예제 #1
0
파일: monster.cs 프로젝트: solwllms/quiver
 public void SetAnim(animation a)
 {
     anim = a;
     anim.Play();
     SetTexture(a.texture);
     dodirectional = false;
 }
예제 #2
0
        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();
                }
            }
        }