AddCounter() публичный Метод

public AddCounter ( ) : void
Результат void
Пример #1
0
        public Dialog(List<Conversation> conversations, Entity owner, int cooldown = 2000)
            : base()
        {
            _enter = new EventHandler(OnEnter);

            _conversations = new List<Conversation>();
            foreach(Conversation con in conversations)
            {
                _conversations.Add(con.Clone());
            }
            _dm = DialogManager.Instance;
            _cm = owner.CM;
            _cm.AddCounter(_cShutdown);
            _cm.Bang += new EventHandler<BangEventArgs>(OnBang);
            _currentCon = _conversations.First().GetIterator();
            this._owner = owner;
            Cooldown = cooldown;

            foreach (Conversation con in _conversations)
            {
                try
                {
                    con.Add(new ComboBreaker());
                }
                catch (ConversationAlreadyFinalisedException e)
                { }

                con.SetOwner(owner);
            }
        }
Пример #2
0
 public void SetOwner(Entity owner)
 {
     _owner = owner;
     _cm = owner.CM;
     _cm.AddCounter(_cShooter, CooldownTime, true);
     _cm.Bang += new EventHandler<BangEventArgs>(OnBang);
 }
Пример #3
0
        public override void SetOwner(Entity owner)
        {
            base.SetOwner(owner);

            _cm = owner.CM;
            _cm.AddCounter(_cInvulnerable, _invulnerableDuration);
            _cm.Bang += new EventHandler<BangEventArgs>(OnBang);
        }
Пример #4
0
        public Player(Game game)
            : base(game, Vector2.Zero, null)
        {
            _weaponRange = Constants.Player_WeaponRange;
            _cm = new CounterManager();
            _cm.Bang += new EventHandler<BangEventArgs>(OnBang);

            (Game as Game1)._input.Potion.Pressed += new EventHandler(UsePotion);

            _cm.AddCounter(_hitCounter, Constants.Player_HitDuration);
            _radius = Constants.Player_Radius;

            //FrameCounter
            _cm.AddCounter(_animCounter, 250);
            _cm.StartCounter(_animCounter,false);

            _health = 500;
            _canBeAttacked = true;
        }
Пример #5
0
 public Entity(Game1 game, Vector2 position, String name = "Entity")
     : base(game)
 {
     this.Position = position;
     this.Health = 5;
     this.Name = name;
     this.Invulnerable = false;
     Face = Facing.DOWN;
     CM = new CounterManager();
     CM.AddCounter(_cInvulnerable, _invulnerableDuration);
     CM.Bang += new EventHandler<BangEventArgs>(OnBang);
 }
Пример #6
0
        public EntityGruselUte(Game game, Vector2 position, Texture2D texture)
            : base(game, position, texture)
        {
            _health = Constants.GruselUte_Health;
            _canBeAttacked = true;
            _radius = Constants.GruselUte_Radius;
            _animTexture = texture;
            _weaponRange = Constants.GruselUte_HitRange;
            _animTexture = texture;
            _animSource = new Vector2(0, 0);
            _animated = true;

            _cm = new CounterManager();
            _cm.Bang += new EventHandler<BangEventArgs>(OnBang);
            _cm.AddCounter(_hitCounter, Constants.Player_HitDuration);
        }
Пример #7
0
 public void SetOwner(Entity owner)
 {
     _owner = owner;
     _cm = owner.CM;
     _cm.AddCounter(_cSwingHit, Duration, true);
     _cm.Bang += new EventHandler<BangEventArgs>(OnBang);
 }
Пример #8
0
        public override void SetOwner(Entity owner)
        {
            _cm = owner.CM;
            _cm.AddCounter(_cShutdown);
            _cm.Bang += new EventHandler<BangEventArgs>(OnBang);
            _currentCon = _conversations.First().GetIterator();
            this._owner = owner;

            foreach (Conversation con in _conversations)
            {
                try
                {
                    con.Add(new ComboBreaker());
                }
                catch (ConversationAlreadyFinalisedException e)
                { }

                con.SetOwner(owner);
            }
        }
Пример #9
0
        public void SetOwner(Entity owner)
        {
            _owner = owner;

            _cm = owner.CM;
            _cm.Bang += new EventHandler<BangEventArgs>(OnBang);
            _cm.AddCounter(_cJump);

            _owner = owner;
        }